种植计划页面;土地巡查列表&详情
This commit is contained in:
parent
a91d71e1d8
commit
4c81e94cc7
@ -47,6 +47,7 @@ android {
|
|||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
storeFile file('../key/tairui.jks')
|
storeFile file('../key/tairui.jks')
|
||||||
@ -58,6 +59,7 @@ android {
|
|||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
buildConfigField "String", "DOMAIN", '"http://192.168.18.74:8080"'
|
||||||
jniDebuggable false
|
jniDebuggable false
|
||||||
zipAlignEnabled false
|
zipAlignEnabled false
|
||||||
}
|
}
|
||||||
@ -66,6 +68,7 @@ android {
|
|||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
jniDebuggable false
|
jniDebuggable false
|
||||||
|
buildConfigField "String", "DOMAIN", '"http://47.109.205.240:8080"'
|
||||||
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
@ -153,6 +153,26 @@
|
|||||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.land.EditPlantPlanActivity"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.land.EditPlantActualActivity"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.land.InspectionListActivity"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
|
<activity
|
||||||
|
android:name=".ui.land.InspectionDetailActivity"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.photoview.PhotoViewActivty"
|
android:name=".ui.photoview.PhotoViewActivty"
|
||||||
|
@ -143,10 +143,15 @@ public abstract class BaseActivity<T extends ViewBinding> extends AppCompatActiv
|
|||||||
protected void showToast(String str) {
|
protected void showToast(String str) {
|
||||||
Toast.makeText(mContext, str, Toast.LENGTH_LONG).show();
|
Toast.makeText(mContext, str, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showError(String str) {
|
protected void showError(String str) {
|
||||||
PopTip.show(str).iconError();
|
PopTip.show(str).iconError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void showSuccess(String str) {
|
||||||
|
PopTip.show(str).iconSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
protected void setText(TextView view, String txt, String defaultTxt) {
|
protected void setText(TextView view, String txt, String defaultTxt) {
|
||||||
if (view != null) {
|
if (view != null) {
|
||||||
view.setText(TextUtils.isEmpty(txt) ? defaultTxt : txt);
|
view.setText(TextUtils.isEmpty(txt) ? defaultTxt : txt);
|
||||||
|
@ -2,6 +2,7 @@ package com.tairui.gov_affairs_cloud.config;
|
|||||||
|
|
||||||
import com.orhanobut.hawk.Hawk;
|
import com.orhanobut.hawk.Hawk;
|
||||||
import com.tairui.gov_affairs_cloud.entity.Constant;
|
import com.tairui.gov_affairs_cloud.entity.Constant;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.my.entity.UserInfoEntity;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
@ -17,6 +18,7 @@ public class AppConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String token;
|
private String token;
|
||||||
|
private UserInfoEntity userInfo;
|
||||||
|
|
||||||
public String getToken() {
|
public String getToken() {
|
||||||
if (TextUtils.isEmpty(token)) {
|
if (TextUtils.isEmpty(token)) {
|
||||||
@ -28,4 +30,16 @@ public class AppConfig {
|
|||||||
public void setToken(String token) {
|
public void setToken(String token) {
|
||||||
this.token = token;
|
this.token = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UserInfoEntity getUserInfo() {
|
||||||
|
if (userInfo == null && Hawk.contains(Constant.USER_INFO)) {
|
||||||
|
userInfo = Hawk.get(Constant.USER_INFO);
|
||||||
|
}
|
||||||
|
return userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserInfo(UserInfoEntity userInfo) {
|
||||||
|
this.userInfo = userInfo;
|
||||||
|
Hawk.put(Constant.USER_INFO, userInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package com.tairui.gov_affairs_cloud.entity;
|
package com.tairui.gov_affairs_cloud.entity;
|
||||||
|
|
||||||
|
import com.tairui.gov_affairs_cloud.BuildConfig;
|
||||||
|
|
||||||
public class Api {
|
public class Api {
|
||||||
|
|
||||||
public static String BASE_HOST = "http://192.168.18.9:8080";
|
public static String BASE_HOST = BuildConfig.DOMAIN;
|
||||||
// public static String BASE_HOST = "http://47.109.205.240:8080";
|
|
||||||
public static String OSS_HOST = "http://gov-cloud.oss-cn-chengdu.aliyuncs.com/";
|
public static String OSS_HOST = "http://gov-cloud.oss-cn-chengdu.aliyuncs.com/";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,6 +33,8 @@ public class Api {
|
|||||||
public static final String CAPTCHA = BASE_HOST + "/auth/app/captcha";
|
public static final String CAPTCHA = BASE_HOST + "/auth/app/captcha";
|
||||||
public static final String HOME = BASE_HOST + "/app/home/data";
|
public static final String HOME = BASE_HOST + "/app/home/data";
|
||||||
public static final String USER_INFO = BASE_HOST + "/app/my/info";
|
public static final String USER_INFO = BASE_HOST + "/app/my/info";
|
||||||
|
|
||||||
|
/* 土地信息 */
|
||||||
public static final String LAND_OVERVIEW = BASE_HOST + "/land-resource/analysis/overview";
|
public static final String LAND_OVERVIEW = BASE_HOST + "/land-resource/analysis/overview";
|
||||||
public static final String LAND_SUB_AREA = BASE_HOST + "/land-resource/analysis/subArea";
|
public static final String LAND_SUB_AREA = BASE_HOST + "/land-resource/analysis/subArea";
|
||||||
public static final String LAND_AREA_REGION = BASE_HOST + "/system/area/region";
|
public static final String LAND_AREA_REGION = BASE_HOST + "/system/area/region";
|
||||||
@ -43,9 +46,19 @@ public class Api {
|
|||||||
public static final String LAND_TYPE = BASE_HOST + "/land-resource/baseInfo/landTree";
|
public static final String LAND_TYPE = BASE_HOST + "/land-resource/baseInfo/landTree";
|
||||||
public static final String LAND_RESOURCE_TYPE_NO_CHILD = BASE_HOST + "/land-resource/baseInfo/landTypeNoChild";
|
public static final String LAND_RESOURCE_TYPE_NO_CHILD = BASE_HOST + "/land-resource/baseInfo/landTypeNoChild";
|
||||||
public static final String LAND_RESOURCE_LIST = BASE_HOST + "/land-resource/landManage/page";
|
public static final String LAND_RESOURCE_LIST = BASE_HOST + "/land-resource/landManage/page";
|
||||||
|
/* 种植计划 */
|
||||||
public static final String PLANT_PLAN_HOME = BASE_HOST + "/land-resource/annualManage/app/main";
|
public static final String PLANT_PLAN_HOME = BASE_HOST + "/land-resource/annualManage/app/main";
|
||||||
public static final String PLANT_PLAN_LIST = BASE_HOST + "/land-resource/annualManage/page";
|
public static final String PLANT_PLAN_LIST = BASE_HOST + "/land-resource/annualManage/page";
|
||||||
public static final String PLANT_PLAN_CROPS = BASE_HOST + "/land-resource/crops/list";
|
public static final String PLANT_PLAN_CROPS = BASE_HOST + "/land-resource/crops/list";
|
||||||
public static final String PLANT_PLAN_DETAIL = BASE_HOST + "/land-resource/annualManage/";
|
public static final String PLANT_PLAN_DETAIL = BASE_HOST + "/land-resource/annualManage/";
|
||||||
|
public static final String PLANT_PLAN_ADD = BASE_HOST + "/land-resource/annualManage/save";
|
||||||
|
public static final String PLANT_PLAN_EDIT = BASE_HOST + "/land-resource/annualManage/edit";
|
||||||
|
public static final String PLANT_PLAN_ACTUAL = BASE_HOST + "/land-resource/annualManage/save-actual";
|
||||||
|
|
||||||
|
/* 土地巡查 */
|
||||||
|
public static final String INSPECTION_STATUS = BASE_HOST + "/system/dict/data/type/land_inspection_status";
|
||||||
|
public static final String INSPECTION_TYPE = BASE_HOST + "/system/dict/data/type/land_res_patrol_type";
|
||||||
|
public static final String INSPECTION_LIST_ADMIN = BASE_HOST + "/land-resource/landInspection/page";
|
||||||
|
public static final String INSPECTION_LIST_GENERAL = BASE_HOST + "/land-resource/landInspection/page/general";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@ public class Constant {
|
|||||||
|
|
||||||
public static String TOKEN = "token";
|
public static String TOKEN = "token";
|
||||||
|
|
||||||
|
public static String USER_INFO = "user_info";
|
||||||
|
|
||||||
public static String LOGIN_USER_NAME = "login_user_name";
|
public static String LOGIN_USER_NAME = "login_user_name";
|
||||||
|
|
||||||
public static String SELECT_REGION = "select_region";
|
public static String SELECT_REGION = "select_region";
|
||||||
|
@ -8,12 +8,14 @@ import com.chad.library.adapter.base.BaseViewHolder;
|
|||||||
import com.rxjava.rxlife.RxLife;
|
import com.rxjava.rxlife.RxLife;
|
||||||
import com.tairui.gov_affairs_cloud.R;
|
import com.tairui.gov_affairs_cloud.R;
|
||||||
import com.tairui.gov_affairs_cloud.base.BaseFragment;
|
import com.tairui.gov_affairs_cloud.base.BaseFragment;
|
||||||
|
import com.tairui.gov_affairs_cloud.config.AppConfig;
|
||||||
import com.tairui.gov_affairs_cloud.databinding.FragmentHomeBinding;
|
import com.tairui.gov_affairs_cloud.databinding.FragmentHomeBinding;
|
||||||
import com.tairui.gov_affairs_cloud.entity.Api;
|
import com.tairui.gov_affairs_cloud.entity.Api;
|
||||||
import com.tairui.gov_affairs_cloud.entity.PieBean;
|
import com.tairui.gov_affairs_cloud.entity.PieBean;
|
||||||
import com.tairui.gov_affairs_cloud.http.OnError;
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
import com.tairui.gov_affairs_cloud.ui.home.entity.HomeEntity;
|
import com.tairui.gov_affairs_cloud.ui.home.entity.HomeEntity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.LandActivity;
|
import com.tairui.gov_affairs_cloud.ui.land.LandActivity;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.my.entity.UserInfoEntity;
|
||||||
import com.tairui.gov_affairs_cloud.util.DensityUtils;
|
import com.tairui.gov_affairs_cloud.util.DensityUtils;
|
||||||
import com.tairui.gov_affairs_cloud.util.IntentUtil;
|
import com.tairui.gov_affairs_cloud.util.IntentUtil;
|
||||||
import com.tairui.gov_affairs_cloud.util.glide.GlideLoader;
|
import com.tairui.gov_affairs_cloud.util.glide.GlideLoader;
|
||||||
@ -102,6 +104,18 @@ public class HomeFragment extends BaseFragment<FragmentHomeBinding> {
|
|||||||
binding.loadingView.setVisibility(View.GONE);
|
binding.loadingView.setVisibility(View.GONE);
|
||||||
binding.blankView.setVisibility(View.VISIBLE);
|
binding.blankView.setVisibility(View.VISIBLE);
|
||||||
});
|
});
|
||||||
|
getUserInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getUserInfo() {
|
||||||
|
RxHttp.get(Api.USER_INFO)
|
||||||
|
.asResponse(UserInfoEntity.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
AppConfig.getInstance().setUserInfo(data);
|
||||||
|
}, (OnError) error -> {
|
||||||
|
showToast(error.getErrorMsg());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initView(HomeEntity data) {
|
private void initView(HomeEntity data) {
|
||||||
|
@ -3,6 +3,8 @@ package com.tairui.gov_affairs_cloud.ui.land;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
import com.contrarywind.interfaces.IPickerViewData;
|
import com.contrarywind.interfaces.IPickerViewData;
|
||||||
@ -10,14 +12,23 @@ import com.rxjava.rxlife.RxLife;
|
|||||||
import com.tairui.gov_affairs_cloud.base.BaseActivity;
|
import com.tairui.gov_affairs_cloud.base.BaseActivity;
|
||||||
import com.tairui.gov_affairs_cloud.databinding.ActivityAddPlantPlanBinding;
|
import com.tairui.gov_affairs_cloud.databinding.ActivityAddPlantPlanBinding;
|
||||||
import com.tairui.gov_affairs_cloud.entity.Api;
|
import com.tairui.gov_affairs_cloud.entity.Api;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventConstant;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventMessage;
|
||||||
import com.tairui.gov_affairs_cloud.http.OnError;
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.entity.CropsEntity;
|
import com.tairui.gov_affairs_cloud.ui.land.entity.CropsEntity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.entity.LandAreaRegionEntity;
|
import com.tairui.gov_affairs_cloud.ui.land.entity.LandAreaRegionEntity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.entity.LandGridEntity;
|
import com.tairui.gov_affairs_cloud.ui.land.entity.LandGridEntity;
|
||||||
import com.tairui.gov_affairs_cloud.util.ArrayUtil;
|
import com.tairui.gov_affairs_cloud.util.ArrayUtil;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.DateUtils;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.DecimalDigitsInputFilter;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.KeybordUtil;
|
||||||
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.InputType;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import rxhttp.RxHttp;
|
import rxhttp.RxHttp;
|
||||||
|
|
||||||
@ -45,6 +56,12 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
return ActivityAddPlantPlanBinding.class;
|
return ActivityAddPlantPlanBinding.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFindView(Bundle savedInstanceState) {
|
||||||
|
binding.inputArea.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||||
|
binding.inputArea.setFilters(new InputFilter[] {new DecimalDigitsInputFilter()});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onBindListener() {
|
protected void onBindListener() {
|
||||||
binding.btnBack.setOnClickListener(new SingleClickListener() {
|
binding.btnBack.setOnClickListener(new SingleClickListener() {
|
||||||
@ -53,44 +70,40 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.layoutRegion.setOnClickListener(new SingleClickListener() {
|
|
||||||
@Override
|
|
||||||
protected void onSingleClick(View v) {
|
|
||||||
showRegionDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
binding.layoutGrid.setOnClickListener(new SingleClickListener() {
|
binding.layoutGrid.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
if (selectRegion == null) {
|
KeybordUtil.hideSoftInput(mContext, binding.layoutGrid);
|
||||||
showError("请先选择所属行政区域");
|
showRegionDialog();
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (selectGrid == null) {
|
|
||||||
getGridData();
|
|
||||||
} else {
|
|
||||||
showLandGridDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.layoutCrops.setOnClickListener(new SingleClickListener() {
|
binding.layoutCrops.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
|
KeybordUtil.hideSoftInput(mContext, binding.layoutCrops);
|
||||||
showCropsDialog();
|
showCropsDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.layoutMonth.setOnClickListener(new SingleClickListener() {
|
binding.layoutMonth.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
|
KeybordUtil.hideSoftInput(mContext, binding.layoutMonth);
|
||||||
showMonthDialog();
|
showMonthDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.layoutCycle.setOnClickListener(new SingleClickListener() {
|
binding.layoutCycle.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
|
KeybordUtil.hideSoftInput(mContext, binding.layoutCycle);
|
||||||
showCycleUnitDialog();
|
showCycleUnitDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
binding.btnSubmit.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
checkSubmit();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -118,8 +131,8 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
|
|
||||||
landRegionPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
landRegionPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
selectRegion = landAreaRegionData.get(0).getAreaChildVOS().get(options1).getAreaChildVOS().get(options2);
|
selectRegion = landAreaRegionData.get(0).getAreaChildVOS().get(options1).getAreaChildVOS().get(options2);
|
||||||
setText(binding.tvRegion, selectRegion.getAreaName());
|
|
||||||
selectGrid = null;
|
selectGrid = null;
|
||||||
|
getGridData();
|
||||||
}).setTitleText("土地区域选择").setContentTextSize(20)
|
}).setTitleText("土地区域选择").setContentTextSize(20)
|
||||||
.setSelectOptions(0, 0)
|
.setSelectOptions(0, 0)
|
||||||
.setTitleBgColor(Color.WHITE)
|
.setTitleBgColor(Color.WHITE)
|
||||||
@ -155,7 +168,7 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
if (landGridPickerView == null) {
|
if (landGridPickerView == null) {
|
||||||
landGridPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
landGridPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
selectGrid = landGridData.getRecords().get(options1);
|
selectGrid = landGridData.getRecords().get(options1);
|
||||||
setText(binding.tvGrid, selectGrid.getGridName());
|
setText(binding.tvGrid, selectRegion.getAreaName() + "-" + selectGrid.getGridName());
|
||||||
}).setTitleText("土地网格选择").setContentTextSize(20)
|
}).setTitleText("土地网格选择").setContentTextSize(20)
|
||||||
.setSelectOptions(0)
|
.setSelectOptions(0)
|
||||||
.setTitleBgColor(Color.WHITE)
|
.setTitleBgColor(Color.WHITE)
|
||||||
@ -248,7 +261,7 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
}
|
}
|
||||||
List<PickerEntity> cycleData = new ArrayList<>();
|
List<PickerEntity> cycleData = new ArrayList<>();
|
||||||
if (growthCycleUnit == 1) {
|
if (growthCycleUnit == 1) {
|
||||||
for (int i = 1; i < 32; i++) {
|
for (int i = 1; i < 366; i++) {
|
||||||
cycleData.add(new PickerEntity(i + "天"));
|
cycleData.add(new PickerEntity(i + "天"));
|
||||||
}
|
}
|
||||||
} else if (growthCycleUnit == 2) {
|
} else if (growthCycleUnit == 2) {
|
||||||
@ -257,7 +270,7 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
}
|
}
|
||||||
} else if (growthCycleUnit == 3) {
|
} else if (growthCycleUnit == 3) {
|
||||||
for (int i = 1; i < 13; i++) {
|
for (int i = 1; i < 13; i++) {
|
||||||
cycleData.add(new PickerEntity(i + "月"));
|
cycleData.add(new PickerEntity(i + "个月"));
|
||||||
}
|
}
|
||||||
} else if (growthCycleUnit == 4) {
|
} else if (growthCycleUnit == 4) {
|
||||||
for (int i = 1; i < 6; i++) {
|
for (int i = 1; i < 6; i++) {
|
||||||
@ -310,7 +323,7 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
unitStr = "周";
|
unitStr = "周";
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
unitStr = "月";
|
unitStr = "个月";
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
unitStr = "年";
|
unitStr = "年";
|
||||||
@ -322,4 +335,64 @@ public class AddPlantPlanActivity extends BaseActivity<ActivityAddPlantPlanBindi
|
|||||||
return unitStr;
|
return unitStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkSubmit() {
|
||||||
|
if (selectRegion == null || selectGrid == null) {
|
||||||
|
showError("请选择所属网格");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String planName = binding.inputPlanName.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(planName)) {
|
||||||
|
showError("请输入计划名称");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (selectCrop == null) {
|
||||||
|
showError("请选择种植作物种类");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String planArea = binding.inputArea.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(planArea)) {
|
||||||
|
showError("请输入计划种植面积");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (TextUtils.isEmpty(selectMonth)) {
|
||||||
|
showError("请选择种植月份");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (TextUtils.isEmpty(growthCycle) || growthCycleUnit == -1) {
|
||||||
|
showError("请选择生长周期");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
double area = Double.parseDouble(planArea);
|
||||||
|
doAddPlan(planName, area);
|
||||||
|
} catch (Exception e) {
|
||||||
|
showError("种植面积只可以输入数字");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doAddPlan(String planName, double planArea) {
|
||||||
|
showLoading();
|
||||||
|
RxHttp.postJson(Api.PLANT_PLAN_ADD)
|
||||||
|
.add("year", DateUtils.getCurrentYear())
|
||||||
|
.add("regionCode", selectRegion.getAreaCode())
|
||||||
|
.add("gridId", selectGrid.getId())
|
||||||
|
.add("planName", planName)
|
||||||
|
.add("cropsId", selectCrop.getId())
|
||||||
|
.add("plantingArea", planArea)
|
||||||
|
.add("plantingMonths", selectMonth)
|
||||||
|
.add("growthCycle", growthCycle)
|
||||||
|
.add("growthCycleUnit", growthCycleUnit)
|
||||||
|
.asResponse(Object.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
hideLoading();
|
||||||
|
showSuccess("计划添加成功");
|
||||||
|
EventBus.getDefault().post(new EventMessage(EventConstant.REFRESH_LIST));
|
||||||
|
binding.btnSubmit.postDelayed(() -> finish(), 1000);
|
||||||
|
}, (OnError) error -> {
|
||||||
|
hideLoading();
|
||||||
|
showError(error.getErrorMsg());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,232 @@
|
|||||||
|
package com.tairui.gov_affairs_cloud.ui.land;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
|
import com.contrarywind.interfaces.IPickerViewData;
|
||||||
|
import com.rxjava.rxlife.RxLife;
|
||||||
|
import com.tairui.gov_affairs_cloud.base.BaseActivity;
|
||||||
|
import com.tairui.gov_affairs_cloud.databinding.ActivityEditPlantActualBinding;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.Api;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventConstant;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventMessage;
|
||||||
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.entity.PlantPlanDetailEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.DecimalDigitsInputFilter;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.KeybordUtil;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.InputType;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import rxhttp.RxHttp;
|
||||||
|
|
||||||
|
public class EditPlantActualActivity extends BaseActivity<ActivityEditPlantActualBinding> {
|
||||||
|
|
||||||
|
private String selectMonth;
|
||||||
|
private String growthCycle;
|
||||||
|
|
||||||
|
private OptionsPickerView monthPickerView;
|
||||||
|
|
||||||
|
private PlantPlanDetailEntity mData;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<ActivityEditPlantActualBinding> getBindingClass() {
|
||||||
|
return ActivityEditPlantActualBinding.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onQueryArguments() {
|
||||||
|
mData = (PlantPlanDetailEntity) getIntent().getSerializableExtra("data");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFindView(Bundle savedInstanceState) {
|
||||||
|
binding.inputArea.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||||
|
binding.inputArea.setFilters(new InputFilter[] {new DecimalDigitsInputFilter()});
|
||||||
|
|
||||||
|
binding.tvGrid.setText(mData.getGridName());
|
||||||
|
binding.inputPlanName.setText(mData.getPlanName());
|
||||||
|
binding.tvCrops.setText(mData.getCropsName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onBindListener() {
|
||||||
|
binding.btnBack.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.layoutMonth.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
KeybordUtil.hideSoftInput(mContext, binding.layoutMonth);
|
||||||
|
showMonthDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.layoutCycle.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
KeybordUtil.hideSoftInput(mContext, binding.layoutCycle);
|
||||||
|
showCyclDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.btnSubmit.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
checkSubmit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showMonthDialog() {
|
||||||
|
if (monthPickerView == null) {
|
||||||
|
List<PickerEntity> monthData = new ArrayList<>();
|
||||||
|
for (int i = 0; i < 12; i++) {
|
||||||
|
monthData.add(new PickerEntity((i + 1) + "月"));
|
||||||
|
}
|
||||||
|
monthPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
|
selectMonth = String.valueOf(options1 + 1);
|
||||||
|
setText(binding.tvMonth, selectMonth + "月");
|
||||||
|
}).setTitleText("种植月份选择").setContentTextSize(20)
|
||||||
|
.setSelectOptions(0)
|
||||||
|
.setTitleBgColor(Color.WHITE)
|
||||||
|
.isRestoreItem(true)
|
||||||
|
.isCenterLabel(false)
|
||||||
|
.setOutSideColor(0x00000000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
monthPickerView.setPicker(monthData);
|
||||||
|
}
|
||||||
|
monthPickerView.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showCyclDialog() {
|
||||||
|
List<PickerEntity> cycleData = new ArrayList<>();
|
||||||
|
int growthCycleUnit = Integer.parseInt(mData.getPlanParameters().getGrowthCycleUnit());
|
||||||
|
if (growthCycleUnit == 1) {
|
||||||
|
for (int i = 1; i < 366; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "天"));
|
||||||
|
}
|
||||||
|
} else if (growthCycleUnit == 2) {
|
||||||
|
for (int i = 1; i < 53; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "周"));
|
||||||
|
}
|
||||||
|
} else if (growthCycleUnit == 3) {
|
||||||
|
for (int i = 1; i < 13; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "个月"));
|
||||||
|
}
|
||||||
|
} else if (growthCycleUnit == 4) {
|
||||||
|
for (int i = 1; i < 6; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "年"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OptionsPickerView cyclePickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
|
growthCycle = String.valueOf(options1 + 1);
|
||||||
|
setText(binding.tvCycle, growthCycle + getCycleUnit(growthCycleUnit));
|
||||||
|
}).setTitleText("种植周期时长选择").setContentTextSize(20)
|
||||||
|
.setSelectOptions(0)
|
||||||
|
.setTitleBgColor(Color.WHITE)
|
||||||
|
.isRestoreItem(true)
|
||||||
|
.isCenterLabel(false)
|
||||||
|
.setOutSideColor(0x00000000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
cyclePickerView.setPicker(cycleData);
|
||||||
|
cyclePickerView.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PickerEntity implements IPickerViewData {
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public PickerEntity(String m) {
|
||||||
|
this.name = m;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPickerViewText() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getCycleUnit(int unit) {
|
||||||
|
String unitStr;
|
||||||
|
switch (unit) {
|
||||||
|
case 1:
|
||||||
|
unitStr = "天";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
unitStr = "周";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
unitStr = "个月";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
unitStr = "年";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
unitStr = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return unitStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkSubmit() {
|
||||||
|
String planArea = binding.inputArea.getText().toString().trim();
|
||||||
|
if (TextUtils.isEmpty(planArea)) {
|
||||||
|
showError("请输入计划种植面积");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (TextUtils.isEmpty(selectMonth)) {
|
||||||
|
showError("请选择种植月份");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (TextUtils.isEmpty(growthCycle)) {
|
||||||
|
showError("请选择生长周期");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
double area = Double.parseDouble(planArea);
|
||||||
|
doAddPlanActual(area);
|
||||||
|
} catch (Exception e) {
|
||||||
|
showError("种植面积只可以输入数字");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doAddPlanActual(double planArea) {
|
||||||
|
showLoading();
|
||||||
|
RxHttp.postJson(Api.PLANT_PLAN_ACTUAL)
|
||||||
|
.add("planId", mData.getId())
|
||||||
|
.add("plantingArea", planArea)
|
||||||
|
.add("plantingMonths", selectMonth)
|
||||||
|
.add("growthCycle", growthCycle)
|
||||||
|
.add("growthCycleUnit", mData.getPlanParameters().getGrowthCycleUnit())
|
||||||
|
.asResponse(Object.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
hideLoading();
|
||||||
|
showSuccess("实际种植情况添加成功");
|
||||||
|
EventBus.getDefault().post(new EventMessage(EventConstant.REFRESH_LIST));
|
||||||
|
binding.btnSubmit.postDelayed(() -> finish(), 1000);
|
||||||
|
}, (OnError) error -> {
|
||||||
|
hideLoading();
|
||||||
|
showError(error.getErrorMsg());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,272 @@
|
|||||||
|
package com.tairui.gov_affairs_cloud.ui.land;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
|
import com.contrarywind.interfaces.IPickerViewData;
|
||||||
|
import com.rxjava.rxlife.RxLife;
|
||||||
|
import com.tairui.gov_affairs_cloud.base.BaseActivity;
|
||||||
|
import com.tairui.gov_affairs_cloud.databinding.ActivityEditPlantPlanBinding;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.Api;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventConstant;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventMessage;
|
||||||
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.entity.PlantPlanDetailEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.DecimalDigitsInputFilter;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.KeybordUtil;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.InputType;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import rxhttp.RxHttp;
|
||||||
|
import rxhttp.RxHttpJsonParam;
|
||||||
|
|
||||||
|
public class EditPlantPlanActivity extends BaseActivity<ActivityEditPlantPlanBinding> {
|
||||||
|
|
||||||
|
private String selectMonth;
|
||||||
|
private String growthCycle;
|
||||||
|
private int growthCycleUnit = -1; //成长周期单位 1:天 2:周 3:月 4:年
|
||||||
|
|
||||||
|
private OptionsPickerView monthPickerView;
|
||||||
|
private OptionsPickerView cycleUnitPickerView;
|
||||||
|
|
||||||
|
private PlantPlanDetailEntity mData;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<ActivityEditPlantPlanBinding> getBindingClass() {
|
||||||
|
return ActivityEditPlantPlanBinding.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onQueryArguments() {
|
||||||
|
mData = (PlantPlanDetailEntity) getIntent().getSerializableExtra("data");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFindView(Bundle savedInstanceState) {
|
||||||
|
binding.inputArea.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
|
||||||
|
binding.inputArea.setFilters(new InputFilter[] {new DecimalDigitsInputFilter()});
|
||||||
|
|
||||||
|
binding.tvGrid.setText(mData.getGridName());
|
||||||
|
binding.inputPlanName.setHint(mData.getPlanName());
|
||||||
|
binding.tvCrops.setText(mData.getCropsName());
|
||||||
|
binding.inputArea.setHint(String.valueOf(mData.getPlanParameters().getPlantingArea()));
|
||||||
|
binding.tvMonth.setHint(mData.getPlanParameters().getPlantingMonths() + "月");
|
||||||
|
binding.tvCycle.setHint(mData.getPlanParameters().getGrowthCycle() + getCycleUnit(
|
||||||
|
Integer.parseInt(mData.getPlanParameters().getGrowthCycleUnit())));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onBindListener() {
|
||||||
|
binding.btnBack.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.layoutMonth.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
KeybordUtil.hideSoftInput(mContext, binding.layoutMonth);
|
||||||
|
showMonthDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.layoutCycle.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
KeybordUtil.hideSoftInput(mContext, binding.layoutCycle);
|
||||||
|
showCycleUnitDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.btnSubmit.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
checkSubmit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showMonthDialog() {
|
||||||
|
if (monthPickerView == null) {
|
||||||
|
List<PickerEntity> monthData = new ArrayList<>();
|
||||||
|
for (int i = 0; i < 12; i++) {
|
||||||
|
monthData.add(new PickerEntity((i + 1) + "月"));
|
||||||
|
}
|
||||||
|
monthPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
|
selectMonth = String.valueOf(options1 + 1);
|
||||||
|
setText(binding.tvMonth, selectMonth + "月");
|
||||||
|
}).setTitleText("种植月份选择").setContentTextSize(20)
|
||||||
|
.setSelectOptions(0)
|
||||||
|
.setTitleBgColor(Color.WHITE)
|
||||||
|
.isRestoreItem(true)
|
||||||
|
.isCenterLabel(false)
|
||||||
|
.setOutSideColor(0x00000000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
monthPickerView.setPicker(monthData);
|
||||||
|
}
|
||||||
|
monthPickerView.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showCycleUnitDialog() {
|
||||||
|
if (cycleUnitPickerView == null) {
|
||||||
|
List<PickerEntity> unitData = new ArrayList<>();
|
||||||
|
unitData.add(new PickerEntity("天"));
|
||||||
|
unitData.add(new PickerEntity("周"));
|
||||||
|
unitData.add(new PickerEntity("月"));
|
||||||
|
unitData.add(new PickerEntity("年"));
|
||||||
|
cycleUnitPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
|
growthCycleUnit = options1 + 1;
|
||||||
|
showCyclDialog();
|
||||||
|
}).setTitleText("种植周期单位选择").setContentTextSize(20)
|
||||||
|
.setSelectOptions(0)
|
||||||
|
.setTitleBgColor(Color.WHITE)
|
||||||
|
.isRestoreItem(true)
|
||||||
|
.isCenterLabel(false)
|
||||||
|
.setOutSideColor(0x00000000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
cycleUnitPickerView.setPicker(unitData);
|
||||||
|
}
|
||||||
|
cycleUnitPickerView.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showCyclDialog() {
|
||||||
|
if (growthCycleUnit == -1) {
|
||||||
|
showError("请先选择生长周期单位");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<PickerEntity> cycleData = new ArrayList<>();
|
||||||
|
if (growthCycleUnit == 1) {
|
||||||
|
for (int i = 1; i < 366; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "天"));
|
||||||
|
}
|
||||||
|
} else if (growthCycleUnit == 2) {
|
||||||
|
for (int i = 1; i < 53; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "周"));
|
||||||
|
}
|
||||||
|
} else if (growthCycleUnit == 3) {
|
||||||
|
for (int i = 1; i < 13; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "个月"));
|
||||||
|
}
|
||||||
|
} else if (growthCycleUnit == 4) {
|
||||||
|
for (int i = 1; i < 6; i++) {
|
||||||
|
cycleData.add(new PickerEntity(i + "年"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OptionsPickerView cyclePickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
|
growthCycle = String.valueOf(options1 + 1);
|
||||||
|
setText(binding.tvCycle, growthCycle + getCycleUnit(growthCycleUnit));
|
||||||
|
}).setTitleText("种植周期时长选择").setContentTextSize(20)
|
||||||
|
.setSelectOptions(0)
|
||||||
|
.setTitleBgColor(Color.WHITE)
|
||||||
|
.isRestoreItem(true)
|
||||||
|
.isCenterLabel(false)
|
||||||
|
.setOutSideColor(0x00000000)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
cyclePickerView.setPicker(cycleData);
|
||||||
|
cyclePickerView.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class PickerEntity implements IPickerViewData {
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public PickerEntity(String m) {
|
||||||
|
this.name = m;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPickerViewText() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getCycleUnit(int unit) {
|
||||||
|
String unitStr;
|
||||||
|
switch (unit) {
|
||||||
|
case 1:
|
||||||
|
unitStr = "天";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
unitStr = "周";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
unitStr = "个月";
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
unitStr = "年";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
unitStr = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return unitStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkSubmit() {
|
||||||
|
boolean hasChange = false;
|
||||||
|
RxHttpJsonParam http = RxHttp.putJson(Api.PLANT_PLAN_EDIT);
|
||||||
|
http.add("id", mData.getId());
|
||||||
|
String planName = binding.inputPlanName.getText().toString().trim();
|
||||||
|
if (!TextUtils.isEmpty(planName)) {
|
||||||
|
http.add("planName", planName);
|
||||||
|
hasChange = true;
|
||||||
|
}
|
||||||
|
String planArea = binding.inputArea.getText().toString().trim();
|
||||||
|
if (!TextUtils.isEmpty(planArea)) {
|
||||||
|
try {
|
||||||
|
double area = Double.parseDouble(planArea);
|
||||||
|
http.add("plantingArea", area);
|
||||||
|
hasChange = true;
|
||||||
|
} catch (Exception e) {
|
||||||
|
showError("种植面积只可以输入数字");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(selectMonth)) {
|
||||||
|
http.add("plantingMonths", selectMonth);
|
||||||
|
hasChange = true;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(growthCycle) && growthCycleUnit != -1) {
|
||||||
|
http.add("growthCycle", growthCycle);
|
||||||
|
http.add("growthCycleUnit", growthCycleUnit);
|
||||||
|
hasChange = true;
|
||||||
|
}
|
||||||
|
if (hasChange) {
|
||||||
|
showLoading();
|
||||||
|
http.asResponse(Object.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
hideLoading();
|
||||||
|
showSuccess("计划修改成功");
|
||||||
|
EventBus.getDefault().post(new EventMessage(EventConstant.REFRESH_LIST));
|
||||||
|
binding.btnSubmit.postDelayed(() -> finish(), 1000);
|
||||||
|
}, (OnError) error -> {
|
||||||
|
hideLoading();
|
||||||
|
showError(error.getErrorMsg());
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.tairui.gov_affairs_cloud.ui.land;
|
||||||
|
|
||||||
|
import com.tairui.gov_affairs_cloud.R;
|
||||||
|
import com.tairui.gov_affairs_cloud.base.BaseActivity;
|
||||||
|
import com.tairui.gov_affairs_cloud.databinding.ActivityInspectionDetailBinding;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.entity.InspectionListEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
public class InspectionDetailActivity extends BaseActivity<ActivityInspectionDetailBinding> {
|
||||||
|
|
||||||
|
private InspectionListEntity.RecordsEntity mData;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<ActivityInspectionDetailBinding> getBindingClass() {
|
||||||
|
return ActivityInspectionDetailBinding.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onQueryArguments() {
|
||||||
|
mData = (InspectionListEntity.RecordsEntity) getIntent().getSerializableExtra("data");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFindView(Bundle savedInstanceState) {
|
||||||
|
setText(binding.tvTaskStatus, mData.getInspectionStatusName());
|
||||||
|
setText(binding.tvTaskCode, mData.getTaskCode());
|
||||||
|
setText(binding.tvTaskName, mData.getTaskName());
|
||||||
|
setText(binding.tvTaskMembers, mData.getTaskMembers());
|
||||||
|
setText(binding.tvTaskType, mData.getInspectionType());
|
||||||
|
setText(binding.tvTaskTarget, mData.getInspectionTarget());
|
||||||
|
setText(binding.tvTaskNotes, mData.getNotes());
|
||||||
|
if (mData.getInspectionStatus().equals("-1")) {
|
||||||
|
binding.tvTaskStatus.setTextColor(getResColor(R.color.color_txt_green));
|
||||||
|
} else if (mData.getInspectionStatus().equals("00")) {
|
||||||
|
binding.tvTaskStatus.setTextColor(getResColor(R.color.color_txt_blue));
|
||||||
|
} else if (mData.getInspectionStatus().equals("01")) {
|
||||||
|
binding.tvTaskStatus.setTextColor(getResColor(R.color.color_txt_orange));
|
||||||
|
} else if (mData.getInspectionStatus().equals("02")) {
|
||||||
|
binding.tvTaskStatus.setTextColor(getResColor(R.color.color_tv_content));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onBindListener() {
|
||||||
|
binding.btnBack.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,373 @@
|
|||||||
|
package com.tairui.gov_affairs_cloud.ui.land;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
|
import com.kongzue.dialogx.dialogs.MessageDialog;
|
||||||
|
import com.kongzue.dialogx.dialogs.PopMenu;
|
||||||
|
import com.kongzue.dialogx.util.ItemDivider;
|
||||||
|
import com.orhanobut.hawk.Hawk;
|
||||||
|
import com.rxjava.rxlife.RxLife;
|
||||||
|
import com.tairui.gov_affairs_cloud.R;
|
||||||
|
import com.tairui.gov_affairs_cloud.base.BaseActivity;
|
||||||
|
import com.tairui.gov_affairs_cloud.config.AppConfig;
|
||||||
|
import com.tairui.gov_affairs_cloud.databinding.ActivityInspectionListBinding;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.Api;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.Constant;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventConstant;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventMessage;
|
||||||
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.entity.DictDataEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.entity.InspectionListEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.entity.LandAreaRegionEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.entity.LandGridEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.my.entity.UserInfoEntity;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.ArrayUtil;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.DensityUtils;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.IntentUtil;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.ToastUtil;
|
||||||
|
import com.tairui.gov_affairs_cloud.widget.RefreshRecyclerView;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import rxhttp.RxHttp;
|
||||||
|
import rxhttp.RxHttpNoBodyParam;
|
||||||
|
|
||||||
|
public class InspectionListActivity extends BaseActivity<ActivityInspectionListBinding> {
|
||||||
|
|
||||||
|
private LandAreaRegionEntity selectRegion;
|
||||||
|
private LandGridEntity.RecordsEntity selectGrid;
|
||||||
|
private DictDataEntity selectType;
|
||||||
|
|
||||||
|
private List<LandAreaRegionEntity> landAreaRegionData;
|
||||||
|
private LandGridEntity landGridData;
|
||||||
|
|
||||||
|
private OptionsPickerView landRegionPickerView;
|
||||||
|
private OptionsPickerView landGridPickerView;
|
||||||
|
|
||||||
|
private InspectionListAdapter mAdapter;
|
||||||
|
private int currentPageIndex = 1;
|
||||||
|
|
||||||
|
private List<DictDataEntity> typeData;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<ActivityInspectionListBinding> getBindingClass() {
|
||||||
|
return ActivityInspectionListBinding.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onQueryArguments() {
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
|
if (Hawk.contains(Constant.SELECT_REGION)) {
|
||||||
|
selectRegion = Hawk.get(Constant.SELECT_REGION);
|
||||||
|
}
|
||||||
|
if (Hawk.contains(Constant.SELECT_GRID)) {
|
||||||
|
selectGrid = Hawk.get(Constant.SELECT_GRID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onFindView(Bundle savedInstanceState) {
|
||||||
|
binding.refreshRecycler.setLayoutManager(new LinearLayoutManager(mContext));
|
||||||
|
mAdapter = new InspectionListAdapter();
|
||||||
|
binding.refreshRecycler.setAdapter(mAdapter);
|
||||||
|
if (selectRegion != null && selectGrid != null) {
|
||||||
|
setText(binding.tvRegion, selectRegion.getAreaName() + "-" + selectGrid.getGridName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onBindListener() {
|
||||||
|
binding.btnBack.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.layoutRegion.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
showRegionDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
binding.refreshRecycler.setRefreshRecyclerListener(new RefreshRecyclerView.RefreshRecyclerListener() {
|
||||||
|
@Override
|
||||||
|
public void onRefresh() {
|
||||||
|
currentPageIndex = 1;
|
||||||
|
requestData(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadmore() {
|
||||||
|
requestData(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlankClick() {
|
||||||
|
binding.refreshRecycler.showLoading();
|
||||||
|
currentPageIndex = 1;
|
||||||
|
requestData(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mAdapter.setOnItemClickListener((baseQuickAdapter, view, i) -> {
|
||||||
|
InspectionListEntity.RecordsEntity item = mAdapter.getItem(i);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putSerializable("data", item);
|
||||||
|
IntentUtil.startActivity(mContext, InspectionDetailActivity.class, bundle);
|
||||||
|
});
|
||||||
|
binding.layoutType.setOnClickListener(new SingleClickListener() {
|
||||||
|
@Override
|
||||||
|
protected void onSingleClick(View v) {
|
||||||
|
showStatusMenu();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onApplyData() {
|
||||||
|
getInspectionTypeData();
|
||||||
|
getRegionData();
|
||||||
|
if (selectRegion != null && selectGrid != null) {
|
||||||
|
binding.refreshRecycler.showLoading();
|
||||||
|
currentPageIndex = 1;
|
||||||
|
requestData(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getRegionData() {
|
||||||
|
RxHttp.get(Api.LAND_AREA_REGION)
|
||||||
|
.add("areaCode", "530926")
|
||||||
|
.asResponseList(LandAreaRegionEntity.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
landAreaRegionData = data;
|
||||||
|
if (selectRegion == null || selectGrid == null) {
|
||||||
|
showRegionNoticeMsg();
|
||||||
|
}
|
||||||
|
}, (OnError) error -> showToast(error.getErrorMsg()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showRegionNoticeMsg() {
|
||||||
|
MessageDialog.show("选择区域", "请先选择网格区域信息", "确定", "取消")
|
||||||
|
.setOkButton((baseDialog, v1) -> {
|
||||||
|
showRegionDialog();
|
||||||
|
return false;
|
||||||
|
}).setCancelButton((dialog, v) -> {
|
||||||
|
finish();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getInspectionTypeData() {
|
||||||
|
RxHttp.get(Api.INSPECTION_TYPE)
|
||||||
|
.asResponseList(DictDataEntity.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
DictDataEntity allItem = new DictDataEntity();
|
||||||
|
allItem.setDictLabel("全部");
|
||||||
|
data.add(0, allItem);
|
||||||
|
typeData = data;
|
||||||
|
}, (OnError) error -> showToast(error.getErrorMsg()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showStatusMenu() {
|
||||||
|
List<CharSequence> menus = new ArrayList<>();
|
||||||
|
for (DictDataEntity item : typeData) {
|
||||||
|
menus.add(item.getDictLabel());
|
||||||
|
}
|
||||||
|
PopMenu.show(binding.layoutType, menus)
|
||||||
|
.setBackgroundColorRes(R.color.white)
|
||||||
|
.setWidth(DensityUtils.dp2px(mContext, 100))
|
||||||
|
.setOnMenuItemClickListener((dialog, text, index) -> {
|
||||||
|
selectType = typeData.get(index);
|
||||||
|
setText(binding.tvType, selectType.getDictLabel());
|
||||||
|
binding.refreshRecycler.showLoading();
|
||||||
|
currentPageIndex = 1;
|
||||||
|
requestData(false);
|
||||||
|
return false;
|
||||||
|
}).setItemDivider(new ItemDivider(15, 15, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getGridData() {
|
||||||
|
RxHttp.get(Api.LAND_GRID_LIST)
|
||||||
|
.add("regionCode", selectRegion.getAreaCode())
|
||||||
|
.asResponse(LandGridEntity.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
hideLoading();
|
||||||
|
if (ArrayUtil.isEmpty(data.getRecords())) {
|
||||||
|
showToast("当前区域下没有网格,请重新选择");
|
||||||
|
binding.layoutRegion.postDelayed(() -> showRegionDialog(), 500);
|
||||||
|
} else {
|
||||||
|
landGridData = data;
|
||||||
|
showLandGridDialog();
|
||||||
|
}
|
||||||
|
}, (OnError) error -> showToast(error.getErrorMsg()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showRegionDialog() {
|
||||||
|
if (landRegionPickerView == null) {
|
||||||
|
List<List<LandAreaRegionEntity>> subLandData = new ArrayList<>();
|
||||||
|
for (LandAreaRegionEntity itemData : landAreaRegionData.get(0).getAreaChildVOS()) {
|
||||||
|
subLandData.add(itemData.getAreaChildVOS());
|
||||||
|
}
|
||||||
|
|
||||||
|
landRegionPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
|
selectRegion = landAreaRegionData.get(0).getAreaChildVOS().get(options1).getAreaChildVOS().get(options2);
|
||||||
|
Hawk.put(Constant.SELECT_REGION, selectRegion);
|
||||||
|
selectGrid = null;
|
||||||
|
Hawk.delete(Constant.SELECT_GRID);
|
||||||
|
getGridData();
|
||||||
|
}).setTitleText("土地区域选择").setContentTextSize(20)
|
||||||
|
.setSelectOptions(0, 0)
|
||||||
|
.setTitleBgColor(Color.WHITE)
|
||||||
|
.isRestoreItem(true)
|
||||||
|
.isCenterLabel(false)
|
||||||
|
.setOutSideColor(0x00000000) //设置外部遮罩颜色
|
||||||
|
.addOnCancelClickListener(view -> finish())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
landRegionPickerView.setPicker(landAreaRegionData.get(0).getAreaChildVOS(), subLandData);//二级选择器
|
||||||
|
}
|
||||||
|
landRegionPickerView.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showGridNoticeMsg() {
|
||||||
|
MessageDialog.show("选择网格", "不继续选择网格信息了吗?", "确定", "取消")
|
||||||
|
.setOkButton((baseDialog, v1) -> {
|
||||||
|
finish();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showLandGridDialog() {
|
||||||
|
if (landGridPickerView == null) {
|
||||||
|
landGridPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
|
selectGrid = landGridData.getRecords().get(options1);
|
||||||
|
Hawk.put(Constant.SELECT_GRID, selectGrid);
|
||||||
|
setText(binding.tvRegion, selectRegion.getAreaName() + "-" + selectGrid.getGridName());
|
||||||
|
binding.refreshRecycler.showLoading();
|
||||||
|
currentPageIndex = 1;
|
||||||
|
requestData(false);
|
||||||
|
}).setTitleText("土地网格选择").setContentTextSize(20)
|
||||||
|
.setSelectOptions(0)
|
||||||
|
.setTitleBgColor(Color.WHITE)
|
||||||
|
.isRestoreItem(true)
|
||||||
|
.isCenterLabel(false)
|
||||||
|
.setOutSideColor(0x00000000)
|
||||||
|
.addOnCancelClickListener(view -> {
|
||||||
|
if (selectGrid == null) {
|
||||||
|
showGridNoticeMsg();
|
||||||
|
}
|
||||||
|
}).build();
|
||||||
|
|
||||||
|
landGridPickerView.setPicker(landGridData.getRecords());
|
||||||
|
}
|
||||||
|
landGridPickerView.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void requestData(boolean loadmore) {
|
||||||
|
UserInfoEntity userInfo = AppConfig.getInstance().getUserInfo();
|
||||||
|
RxHttpNoBodyParam http;
|
||||||
|
if (userInfo.isAdmin()) {
|
||||||
|
http = RxHttp.get(Api.INSPECTION_LIST_ADMIN);
|
||||||
|
} else {
|
||||||
|
http = RxHttp.get(Api.INSPECTION_LIST_GENERAL);
|
||||||
|
}
|
||||||
|
if (selectType != null && !TextUtils.isEmpty(selectType.getDictValue())) {
|
||||||
|
http.add("inspectionTypeCode", selectType.getDictValue());
|
||||||
|
}
|
||||||
|
http.add("gridId", selectGrid.getId())
|
||||||
|
.add("current", currentPageIndex)
|
||||||
|
.add("size", Api.SIZE_PAGE)
|
||||||
|
.asResponse(InspectionListEntity.class)
|
||||||
|
.as(RxLife.asOnMain(this))
|
||||||
|
.subscribe(data -> {
|
||||||
|
if (loadmore) {
|
||||||
|
binding.refreshRecycler.finishLoadMore();
|
||||||
|
}
|
||||||
|
if (!ArrayUtil.isEmpty(data.getRecords())) {
|
||||||
|
if (loadmore) {
|
||||||
|
mAdapter.addData(data.getRecords());
|
||||||
|
} else {
|
||||||
|
mAdapter.setNewData(data.getRecords());
|
||||||
|
}
|
||||||
|
currentPageIndex += 1;
|
||||||
|
if (ArrayUtil.size(data.getRecords()) < Api.SIZE_PAGE) {
|
||||||
|
binding.refreshRecycler.setNoMoreData(true);
|
||||||
|
} else {
|
||||||
|
binding.refreshRecycler.setNoMoreData(false);
|
||||||
|
}
|
||||||
|
binding.refreshRecycler.showContent();
|
||||||
|
} else {
|
||||||
|
binding.refreshRecycler.showError();
|
||||||
|
binding.refreshRecycler.setNoMoreData(true);
|
||||||
|
}
|
||||||
|
}, (OnError) error -> {
|
||||||
|
binding.refreshRecycler.showError();
|
||||||
|
binding.refreshRecycler.setNoMoreData(true);
|
||||||
|
ToastUtil.showLongToast(error.getErrorMsg());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private class InspectionListAdapter extends BaseQuickAdapter<InspectionListEntity.RecordsEntity, BaseViewHolder> {
|
||||||
|
|
||||||
|
public InspectionListAdapter() {
|
||||||
|
super(R.layout.item_inspection);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void convert(@NonNull BaseViewHolder holder, InspectionListEntity.RecordsEntity entity) {
|
||||||
|
holder.setText(R.id.tvName, entity.getTaskName());
|
||||||
|
holder.setText(R.id.tvType, entity.getInspectionType());
|
||||||
|
holder.setText(R.id.tvStatus, entity.getInspectionStatusName());
|
||||||
|
holder.setText(R.id.tvTaskCode, "任务编号:" + entity.getTaskCode());
|
||||||
|
holder.setText(R.id.tvTaskMembers, entity.getTaskMembers());
|
||||||
|
holder.setText(R.id.tvTaskTarget, entity.getInspectionTarget());
|
||||||
|
if (entity.getInspectionStatus().equals("-1")) {
|
||||||
|
holder.setBackgroundRes(R.id.tvStatus, R.drawable.bg_container_light_green_raduis_2);
|
||||||
|
holder.setTextColor(R.id.tvStatus, getResColor(R.color.color_txt_green));
|
||||||
|
} else if (entity.getInspectionStatus().equals("00")) {
|
||||||
|
holder.setBackgroundRes(R.id.tvStatus, R.drawable.bg_container_light_blue_raduis_2);
|
||||||
|
holder.setTextColor(R.id.tvStatus, getResColor(R.color.color_txt_blue));
|
||||||
|
} else if (entity.getInspectionStatus().equals("01")) {
|
||||||
|
holder.setBackgroundRes(R.id.tvStatus, R.drawable.bg_container_light_orange_raduis_2);
|
||||||
|
holder.setTextColor(R.id.tvStatus, getResColor(R.color.color_txt_orange));
|
||||||
|
} else if (entity.getInspectionStatus().equals("02")) {
|
||||||
|
holder.setBackgroundRes(R.id.tvStatus, R.drawable.bg_container_light_gray_raduis_2);
|
||||||
|
holder.setTextColor(R.id.tvStatus, getResColor(R.color.color_tv_content));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onMessageReceive(EventMessage message) {
|
||||||
|
if (null != message && !TextUtils.isEmpty(message.getLabel())) {
|
||||||
|
if (EventConstant.REFRESH_LIST.equals(message.getLabel())) {
|
||||||
|
binding.refreshRecycler.showLoading();
|
||||||
|
currentPageIndex = 1;
|
||||||
|
requestData(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
}
|
@ -92,19 +92,13 @@ public class PlantPlanActivity extends BaseActivity<ActivityPlantPlanBinding> {
|
|||||||
showRegionDialog();
|
showRegionDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.layoutGrid.setOnClickListener(new SingleClickListener() {
|
|
||||||
@Override
|
|
||||||
protected void onSingleClick(View v) {
|
|
||||||
showLandGridDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
binding.layoutPlanSummarize.setOnClickListener(new SingleClickListener() {
|
binding.layoutPlanSummarize.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
goList();
|
goList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.layoutPlanSummarize.setOnClickListener(new SingleClickListener() {
|
binding.layoutGridProgress.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
goList();
|
goList();
|
||||||
@ -122,16 +116,13 @@ public class PlantPlanActivity extends BaseActivity<ActivityPlantPlanBinding> {
|
|||||||
@Override
|
@Override
|
||||||
protected void onApplyData() {
|
protected void onApplyData() {
|
||||||
getRegionData();
|
getRegionData();
|
||||||
if (selectRegion != null) {
|
|
||||||
getGridData();
|
|
||||||
}
|
|
||||||
if (selectRegion != null && selectGrid != null) {
|
if (selectRegion != null && selectGrid != null) {
|
||||||
getPlantPlanData();
|
getPlantPlanData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showRegionNoticeMsg() {
|
private void showRegionNoticeMsg() {
|
||||||
MessageDialog.show("选择区域", "请先选择区域信息", "确定", "取消")
|
MessageDialog.show("选择区域", "请先选择网格区域信息", "确定", "取消")
|
||||||
.setOkButton((baseDialog, v1) -> {
|
.setOkButton((baseDialog, v1) -> {
|
||||||
showRegionDialog();
|
showRegionDialog();
|
||||||
return false;
|
return false;
|
||||||
@ -148,7 +139,7 @@ public class PlantPlanActivity extends BaseActivity<ActivityPlantPlanBinding> {
|
|||||||
.as(RxLife.asOnMain(this))
|
.as(RxLife.asOnMain(this))
|
||||||
.subscribe(data -> {
|
.subscribe(data -> {
|
||||||
landAreaRegionData = data;
|
landAreaRegionData = data;
|
||||||
if (selectRegion == null) {
|
if (selectRegion == null || selectGrid == null) {
|
||||||
showRegionNoticeMsg();
|
showRegionNoticeMsg();
|
||||||
}
|
}
|
||||||
}, (OnError) error -> showToast(error.getErrorMsg()));
|
}, (OnError) error -> showToast(error.getErrorMsg()));
|
||||||
@ -163,13 +154,11 @@ public class PlantPlanActivity extends BaseActivity<ActivityPlantPlanBinding> {
|
|||||||
hideLoading();
|
hideLoading();
|
||||||
if (ArrayUtil.isEmpty(data.getRecords())) {
|
if (ArrayUtil.isEmpty(data.getRecords())) {
|
||||||
showToast("当前区域下没有网格,请重新选择");
|
showToast("当前区域下没有网格,请重新选择");
|
||||||
binding.layoutGrid.postDelayed(() -> showRegionDialog(), 500);
|
binding.layoutRegion.postDelayed(() -> showRegionDialog(), 500);
|
||||||
} else {
|
} else {
|
||||||
landGridData = data;
|
landGridData = data;
|
||||||
if (selectGrid == null) {
|
|
||||||
showLandGridDialog();
|
showLandGridDialog();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, (OnError) error -> showToast(error.getErrorMsg()));
|
}, (OnError) error -> showToast(error.getErrorMsg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +174,6 @@ public class PlantPlanActivity extends BaseActivity<ActivityPlantPlanBinding> {
|
|||||||
Hawk.put(Constant.SELECT_REGION, selectRegion);
|
Hawk.put(Constant.SELECT_REGION, selectRegion);
|
||||||
selectGrid = null;
|
selectGrid = null;
|
||||||
Hawk.delete(Constant.SELECT_GRID);
|
Hawk.delete(Constant.SELECT_GRID);
|
||||||
showLoading();
|
|
||||||
getGridData();
|
getGridData();
|
||||||
}).setTitleText("土地区域选择").setContentTextSize(20)
|
}).setTitleText("土地区域选择").setContentTextSize(20)
|
||||||
.setSelectOptions(0, 0)
|
.setSelectOptions(0, 0)
|
||||||
@ -249,8 +237,7 @@ public class PlantPlanActivity extends BaseActivity<ActivityPlantPlanBinding> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initView() {
|
private void initView() {
|
||||||
setText(binding.tvRegion, selectRegion.getAreaName());
|
setText(binding.tvRegion, selectRegion.getAreaName() + "-" + selectGrid.getGridName());
|
||||||
setText(binding.tvGrid, selectGrid.getGridName());
|
|
||||||
setText(binding.tvYear, DateUtils.getCurrentYear() + "年种植计划");
|
setText(binding.tvYear, DateUtils.getCurrentYear() + "年种植计划");
|
||||||
setText(binding.tvPlanArea, String.valueOf(mData.getTotal().getTotalPlanArea()));
|
setText(binding.tvPlanArea, String.valueOf(mData.getTotal().getTotalPlanArea()));
|
||||||
setText(binding.tvRealArea, String.valueOf(mData.getTotal().getTotalActualArea()));
|
setText(binding.tvRealArea, String.valueOf(mData.getTotal().getTotalActualArea()));
|
||||||
|
@ -8,9 +8,11 @@ import com.tairui.gov_affairs_cloud.entity.Api;
|
|||||||
import com.tairui.gov_affairs_cloud.http.OnError;
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.entity.PlantPlanDetailEntity;
|
import com.tairui.gov_affairs_cloud.ui.land.entity.PlantPlanDetailEntity;
|
||||||
import com.tairui.gov_affairs_cloud.util.AppUtil;
|
import com.tairui.gov_affairs_cloud.util.AppUtil;
|
||||||
|
import com.tairui.gov_affairs_cloud.util.IntentUtil;
|
||||||
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
import com.tairui.gov_affairs_cloud.util.SingleClickListener;
|
||||||
import com.tairui.gov_affairs_cloud.util.glide.GlideLoader;
|
import com.tairui.gov_affairs_cloud.util.glide.GlideLoader;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import rxhttp.RxHttp;
|
import rxhttp.RxHttp;
|
||||||
@ -44,13 +46,17 @@ public class PlantPlanDetailActivity extends BaseActivity<ActivityPlantPlanDetai
|
|||||||
binding.btnEditPlan.setOnClickListener(new SingleClickListener() {
|
binding.btnEditPlan.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putSerializable("data", mData);
|
||||||
|
IntentUtil.startActivity(mContext, EditPlantPlanActivity.class, bundle);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.btnAddRealPlantInfo.setOnClickListener(new SingleClickListener() {
|
binding.btnAddRealPlantInfo.setOnClickListener(new SingleClickListener() {
|
||||||
@Override
|
@Override
|
||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putSerializable("data", mData);
|
||||||
|
IntentUtil.startActivity(mContext, EditPlantActualActivity.class, bundle);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,10 @@ package com.tairui.gov_affairs_cloud.ui.land;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
@ -17,6 +21,8 @@ import com.tairui.gov_affairs_cloud.base.BaseActivity;
|
|||||||
import com.tairui.gov_affairs_cloud.databinding.ActivityPlantPlanListBinding;
|
import com.tairui.gov_affairs_cloud.databinding.ActivityPlantPlanListBinding;
|
||||||
import com.tairui.gov_affairs_cloud.entity.Api;
|
import com.tairui.gov_affairs_cloud.entity.Api;
|
||||||
import com.tairui.gov_affairs_cloud.entity.Constant;
|
import com.tairui.gov_affairs_cloud.entity.Constant;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventConstant;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.EventMessage;
|
||||||
import com.tairui.gov_affairs_cloud.http.OnError;
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.entity.CropsEntity;
|
import com.tairui.gov_affairs_cloud.ui.land.entity.CropsEntity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.entity.LandAreaRegionEntity;
|
import com.tairui.gov_affairs_cloud.ui.land.entity.LandAreaRegionEntity;
|
||||||
@ -66,6 +72,7 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onQueryArguments() {
|
protected void onQueryArguments() {
|
||||||
|
EventBus.getDefault().register(this);
|
||||||
selectRegion = (LandAreaRegionEntity) getIntent().getSerializableExtra(Constant.SELECT_REGION);
|
selectRegion = (LandAreaRegionEntity) getIntent().getSerializableExtra(Constant.SELECT_REGION);
|
||||||
selectGrid = (LandGridEntity.RecordsEntity) getIntent().getSerializableExtra(Constant.SELECT_GRID);
|
selectGrid = (LandGridEntity.RecordsEntity) getIntent().getSerializableExtra(Constant.SELECT_GRID);
|
||||||
}
|
}
|
||||||
@ -75,8 +82,7 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
binding.refreshRecycler.setLayoutManager(new LinearLayoutManager(mContext));
|
binding.refreshRecycler.setLayoutManager(new LinearLayoutManager(mContext));
|
||||||
mAdapter = new PlantPlanListAdapter();
|
mAdapter = new PlantPlanListAdapter();
|
||||||
binding.refreshRecycler.setAdapter(mAdapter);
|
binding.refreshRecycler.setAdapter(mAdapter);
|
||||||
setText(binding.tvRegion, selectRegion.getAreaName());
|
setText(binding.tvRegion, selectRegion.getAreaName() + "-" + selectGrid.getGridName());
|
||||||
setText(binding.tvGrid, selectGrid.getGridName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -99,12 +105,6 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
showRegionDialog();
|
showRegionDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
binding.layoutGrid.setOnClickListener(new SingleClickListener() {
|
|
||||||
@Override
|
|
||||||
protected void onSingleClick(View v) {
|
|
||||||
showLandGridDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
binding.refreshRecycler.setRefreshRecyclerListener(new RefreshRecyclerView.RefreshRecyclerListener() {
|
binding.refreshRecycler.setRefreshRecyclerListener(new RefreshRecyclerView.RefreshRecyclerListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRefresh() {
|
public void onRefresh() {
|
||||||
@ -142,9 +142,6 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
protected void onApplyData() {
|
protected void onApplyData() {
|
||||||
getCropsData();
|
getCropsData();
|
||||||
getRegionData();
|
getRegionData();
|
||||||
if (selectRegion != null) {
|
|
||||||
getGridData();
|
|
||||||
}
|
|
||||||
if (selectRegion != null && selectGrid != null) {
|
if (selectRegion != null && selectGrid != null) {
|
||||||
binding.refreshRecycler.showLoading();
|
binding.refreshRecycler.showLoading();
|
||||||
currentPageIndex = 1;
|
currentPageIndex = 1;
|
||||||
@ -152,17 +149,6 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showRegionNoticeMsg() {
|
|
||||||
MessageDialog.show("选择区域", "请先选择区域信息", "确定", "取消")
|
|
||||||
.setOkButton((baseDialog, v1) -> {
|
|
||||||
showRegionDialog();
|
|
||||||
return false;
|
|
||||||
}).setCancelButton((dialog, v) -> {
|
|
||||||
finish();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void getRegionData() {
|
private void getRegionData() {
|
||||||
RxHttp.get(Api.LAND_AREA_REGION)
|
RxHttp.get(Api.LAND_AREA_REGION)
|
||||||
.add("areaCode", "530926")
|
.add("areaCode", "530926")
|
||||||
@ -170,9 +156,6 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
.as(RxLife.asOnMain(this))
|
.as(RxLife.asOnMain(this))
|
||||||
.subscribe(data -> {
|
.subscribe(data -> {
|
||||||
landAreaRegionData = data;
|
landAreaRegionData = data;
|
||||||
if (selectRegion == null) {
|
|
||||||
showRegionNoticeMsg();
|
|
||||||
}
|
|
||||||
}, (OnError) error -> showToast(error.getErrorMsg()));
|
}, (OnError) error -> showToast(error.getErrorMsg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,13 +199,11 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
hideLoading();
|
hideLoading();
|
||||||
if (ArrayUtil.isEmpty(data.getRecords())) {
|
if (ArrayUtil.isEmpty(data.getRecords())) {
|
||||||
showToast("当前区域下没有网格,请重新选择");
|
showToast("当前区域下没有网格,请重新选择");
|
||||||
binding.layoutGrid.postDelayed(() -> showRegionDialog(), 500);
|
binding.layoutRegion.postDelayed(() -> showRegionDialog(), 500);
|
||||||
} else {
|
} else {
|
||||||
landGridData = data;
|
landGridData = data;
|
||||||
if (selectGrid == null) {
|
|
||||||
showLandGridDialog();
|
showLandGridDialog();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, (OnError) error -> showToast(error.getErrorMsg()));
|
}, (OnError) error -> showToast(error.getErrorMsg()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,13 +219,12 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
Hawk.put(Constant.SELECT_REGION, selectRegion);
|
Hawk.put(Constant.SELECT_REGION, selectRegion);
|
||||||
selectGrid = null;
|
selectGrid = null;
|
||||||
Hawk.delete(Constant.SELECT_GRID);
|
Hawk.delete(Constant.SELECT_GRID);
|
||||||
showLoading();
|
|
||||||
getGridData();
|
getGridData();
|
||||||
}).setTitleText("土地区域选择").setContentTextSize(20)
|
}).setTitleText("土地区域选择").setContentTextSize(20)
|
||||||
.setSelectOptions(0, 0)
|
.setSelectOptions(0, 0)
|
||||||
.setTitleBgColor(Color.WHITE)
|
.setTitleBgColor(Color.WHITE)
|
||||||
.isRestoreItem(true)//切换时是否还原,设置默认选中第一项。
|
.isRestoreItem(true)
|
||||||
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
.isCenterLabel(false)
|
||||||
.setOutSideColor(0x00000000) //设置外部遮罩颜色
|
.setOutSideColor(0x00000000) //设置外部遮罩颜色
|
||||||
.addOnCancelClickListener(view -> finish())
|
.addOnCancelClickListener(view -> finish())
|
||||||
.build();
|
.build();
|
||||||
@ -266,6 +246,7 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
if (landGridPickerView == null) {
|
if (landGridPickerView == null) {
|
||||||
landGridPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
landGridPickerView = new OptionsPickerBuilder(this, (options1, options2, options3, v) -> {
|
||||||
selectGrid = landGridData.getRecords().get(options1);
|
selectGrid = landGridData.getRecords().get(options1);
|
||||||
|
setText(binding.tvRegion, selectRegion.getAreaName() + "-" + selectGrid.getGridName());
|
||||||
Hawk.put(Constant.SELECT_GRID, selectGrid);
|
Hawk.put(Constant.SELECT_GRID, selectGrid);
|
||||||
binding.refreshRecycler.showLoading();
|
binding.refreshRecycler.showLoading();
|
||||||
currentPageIndex = 1;
|
currentPageIndex = 1;
|
||||||
@ -372,4 +353,20 @@ public class PlantPlanListActivity extends BaseActivity<ActivityPlantPlanListBin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
public void onMessageReceive(EventMessage message) {
|
||||||
|
if (null != message && !TextUtils.isEmpty(message.getLabel())) {
|
||||||
|
if (EventConstant.REFRESH_LIST.equals(message.getLabel())) {
|
||||||
|
binding.refreshRecycler.showLoading();
|
||||||
|
currentPageIndex = 1;
|
||||||
|
requestData(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
EventBus.getDefault().unregister(this);
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.tairui.gov_affairs_cloud.ui.land.entity;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class DictDataEntity {
|
||||||
|
|
||||||
|
@SerializedName("createBy")
|
||||||
|
private String createBy;
|
||||||
|
@SerializedName("createTime")
|
||||||
|
private String createTime;
|
||||||
|
@SerializedName("dictCode")
|
||||||
|
private Integer dictCode;
|
||||||
|
@SerializedName("dictSort")
|
||||||
|
private Integer dictSort;
|
||||||
|
@SerializedName("dictLabel")
|
||||||
|
private String dictLabel;
|
||||||
|
@SerializedName("dictValue")
|
||||||
|
private String dictValue;
|
||||||
|
@SerializedName("dictType")
|
||||||
|
private String dictType;
|
||||||
|
@SerializedName("isDefault")
|
||||||
|
private String isDefault;
|
||||||
|
@SerializedName("status")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public String getCreateBy() {
|
||||||
|
return createBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateBy(String createBy) {
|
||||||
|
this.createBy = createBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDictCode() {
|
||||||
|
return dictCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDictCode(Integer dictCode) {
|
||||||
|
this.dictCode = dictCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDictSort() {
|
||||||
|
return dictSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDictSort(Integer dictSort) {
|
||||||
|
this.dictSort = dictSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDictLabel() {
|
||||||
|
return dictLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDictLabel(String dictLabel) {
|
||||||
|
this.dictLabel = dictLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDictValue() {
|
||||||
|
return dictValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDictValue(String dictValue) {
|
||||||
|
this.dictValue = dictValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDictType() {
|
||||||
|
return dictType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDictType(String dictType) {
|
||||||
|
this.dictType = dictType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsDefault() {
|
||||||
|
return isDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDefault(String isDefault) {
|
||||||
|
this.isDefault = isDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,346 @@
|
|||||||
|
package com.tairui.gov_affairs_cloud.ui.land.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class InspectionListEntity {
|
||||||
|
|
||||||
|
@SerializedName("total")
|
||||||
|
private Integer total;
|
||||||
|
@SerializedName("size")
|
||||||
|
private Integer size;
|
||||||
|
@SerializedName("current")
|
||||||
|
private Integer current;
|
||||||
|
@SerializedName("optimizeCountSql")
|
||||||
|
private Boolean optimizeCountSql;
|
||||||
|
@SerializedName("searchCount")
|
||||||
|
private Boolean searchCount;
|
||||||
|
@SerializedName("maxLimit")
|
||||||
|
private Object maxLimit;
|
||||||
|
@SerializedName("countId")
|
||||||
|
private Object countId;
|
||||||
|
@SerializedName("pages")
|
||||||
|
private Integer pages;
|
||||||
|
@SerializedName("records")
|
||||||
|
private List<RecordsEntity> records;
|
||||||
|
@SerializedName("orders")
|
||||||
|
private List<?> orders;
|
||||||
|
|
||||||
|
public Integer getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(Integer total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(Integer size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCurrent() {
|
||||||
|
return current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrent(Integer current) {
|
||||||
|
this.current = current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isOptimizeCountSql() {
|
||||||
|
return optimizeCountSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOptimizeCountSql(Boolean optimizeCountSql) {
|
||||||
|
this.optimizeCountSql = optimizeCountSql;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isSearchCount() {
|
||||||
|
return searchCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchCount(Boolean searchCount) {
|
||||||
|
this.searchCount = searchCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getMaxLimit() {
|
||||||
|
return maxLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxLimit(Object maxLimit) {
|
||||||
|
this.maxLimit = maxLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getCountId() {
|
||||||
|
return countId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCountId(Object countId) {
|
||||||
|
this.countId = countId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPages() {
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPages(Integer pages) {
|
||||||
|
this.pages = pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<RecordsEntity> getRecords() {
|
||||||
|
return records;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecords(List<RecordsEntity> records) {
|
||||||
|
this.records = records;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<?> getOrders() {
|
||||||
|
return orders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrders(List<?> orders) {
|
||||||
|
this.orders = orders;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class RecordsEntity implements Serializable {
|
||||||
|
@SerializedName("id")
|
||||||
|
private String id;
|
||||||
|
@SerializedName("taskCode")
|
||||||
|
private String taskCode;
|
||||||
|
@SerializedName("taskName")
|
||||||
|
private String taskName;
|
||||||
|
@SerializedName("taskMembers")
|
||||||
|
private String taskMembers;
|
||||||
|
@SerializedName("inspectionTypeCode")
|
||||||
|
private String inspectionTypeCode;
|
||||||
|
@SerializedName("inspectionType")
|
||||||
|
private String inspectionType;
|
||||||
|
@SerializedName("notes")
|
||||||
|
private String notes;
|
||||||
|
@SerializedName("inspectionTarget")
|
||||||
|
private String inspectionTarget;
|
||||||
|
@SerializedName("isIllegal")
|
||||||
|
private Object isIllegal;
|
||||||
|
@SerializedName("inspectionStatus")
|
||||||
|
private String inspectionStatus;
|
||||||
|
@SerializedName("inspectionStatusName")
|
||||||
|
private String inspectionStatusName;
|
||||||
|
@SerializedName("inspectionSituation")
|
||||||
|
private Object inspectionSituation;
|
||||||
|
@SerializedName("inspectionUsers")
|
||||||
|
private List<InspectionUsersEntity> inspectionUsers;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskCode() {
|
||||||
|
return taskCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskCode(String taskCode) {
|
||||||
|
this.taskCode = taskCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName() {
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskName(String taskName) {
|
||||||
|
this.taskName = taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskMembers() {
|
||||||
|
return taskMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskMembers(String taskMembers) {
|
||||||
|
this.taskMembers = taskMembers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionTypeCode() {
|
||||||
|
return inspectionTypeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionTypeCode(String inspectionTypeCode) {
|
||||||
|
this.inspectionTypeCode = inspectionTypeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionType() {
|
||||||
|
return inspectionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionType(String inspectionType) {
|
||||||
|
this.inspectionType = inspectionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNotes() {
|
||||||
|
return notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNotes(String notes) {
|
||||||
|
this.notes = notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionTarget() {
|
||||||
|
return inspectionTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionTarget(String inspectionTarget) {
|
||||||
|
this.inspectionTarget = inspectionTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getIsIllegal() {
|
||||||
|
return isIllegal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsIllegal(Object isIllegal) {
|
||||||
|
this.isIllegal = isIllegal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionStatus() {
|
||||||
|
return inspectionStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionStatus(String inspectionStatus) {
|
||||||
|
this.inspectionStatus = inspectionStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionStatusName() {
|
||||||
|
return inspectionStatusName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionStatusName(String inspectionStatusName) {
|
||||||
|
this.inspectionStatusName = inspectionStatusName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getInspectionSituation() {
|
||||||
|
return inspectionSituation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionSituation(Object inspectionSituation) {
|
||||||
|
this.inspectionSituation = inspectionSituation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<InspectionUsersEntity> getInspectionUsers() {
|
||||||
|
return inspectionUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionUsers(List<InspectionUsersEntity> inspectionUsers) {
|
||||||
|
this.inspectionUsers = inspectionUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class InspectionUsersEntity implements Serializable{
|
||||||
|
@SerializedName("createTime")
|
||||||
|
private String createTime;
|
||||||
|
@SerializedName("createUser")
|
||||||
|
private String createUser;
|
||||||
|
@SerializedName("updateTime")
|
||||||
|
private Object updateTime;
|
||||||
|
@SerializedName("updateUser")
|
||||||
|
private Object updateUser;
|
||||||
|
@SerializedName("tenantId")
|
||||||
|
private Integer tenantId;
|
||||||
|
@SerializedName("id")
|
||||||
|
private Long id;
|
||||||
|
@SerializedName("inspectionId")
|
||||||
|
private Long inspectionId;
|
||||||
|
@SerializedName("userId")
|
||||||
|
private Long userId;
|
||||||
|
@SerializedName("userName")
|
||||||
|
private String userName;
|
||||||
|
@SerializedName("deleteFlag")
|
||||||
|
private String deleteFlag;
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateUser() {
|
||||||
|
return createUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateUser(String createUser) {
|
||||||
|
this.createUser = createUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Object updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getUpdateUser() {
|
||||||
|
return updateUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateUser(Object updateUser) {
|
||||||
|
this.updateUser = updateUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTenantId() {
|
||||||
|
return tenantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTenantId(Integer tenantId) {
|
||||||
|
this.tenantId = tenantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getInspectionId() {
|
||||||
|
return inspectionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionId(Long inspectionId) {
|
||||||
|
this.inspectionId = inspectionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeleteFlag() {
|
||||||
|
return deleteFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeleteFlag(String deleteFlag) {
|
||||||
|
this.deleteFlag = deleteFlag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,10 @@
|
|||||||
package com.tairui.gov_affairs_cloud.ui.land.entity;
|
package com.tairui.gov_affairs_cloud.ui.land.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class PlantPlanDetailEntity {
|
public class PlantPlanDetailEntity implements Serializable {
|
||||||
|
|
||||||
@SerializedName("regionCode")
|
@SerializedName("regionCode")
|
||||||
private String regionCode;
|
private String regionCode;
|
||||||
@ -105,7 +107,7 @@ public class PlantPlanDetailEntity {
|
|||||||
this.currentProgress = currentProgress;
|
this.currentProgress = currentProgress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PlanParametersEntity {
|
public static class PlanParametersEntity implements Serializable{
|
||||||
@SerializedName("plantingArea")
|
@SerializedName("plantingArea")
|
||||||
private Double plantingArea;
|
private Double plantingArea;
|
||||||
@SerializedName("plantingMonths")
|
@SerializedName("plantingMonths")
|
||||||
@ -148,7 +150,7 @@ public class PlantPlanDetailEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ActualParametersEntity {
|
public static class ActualParametersEntity implements Serializable{
|
||||||
@SerializedName("plantingArea")
|
@SerializedName("plantingArea")
|
||||||
private Double plantingArea;
|
private Double plantingArea;
|
||||||
@SerializedName("plantingMonths")
|
@SerializedName("plantingMonths")
|
||||||
|
@ -4,8 +4,10 @@ import com.kongzue.dialogx.dialogs.MessageDialog;
|
|||||||
import com.orhanobut.hawk.Hawk;
|
import com.orhanobut.hawk.Hawk;
|
||||||
import com.rxjava.rxlife.RxLife;
|
import com.rxjava.rxlife.RxLife;
|
||||||
import com.tairui.gov_affairs_cloud.base.BaseFragment;
|
import com.tairui.gov_affairs_cloud.base.BaseFragment;
|
||||||
|
import com.tairui.gov_affairs_cloud.config.AppConfig;
|
||||||
import com.tairui.gov_affairs_cloud.databinding.FragmentMyBinding;
|
import com.tairui.gov_affairs_cloud.databinding.FragmentMyBinding;
|
||||||
import com.tairui.gov_affairs_cloud.entity.Api;
|
import com.tairui.gov_affairs_cloud.entity.Api;
|
||||||
|
import com.tairui.gov_affairs_cloud.entity.Constant;
|
||||||
import com.tairui.gov_affairs_cloud.http.OnError;
|
import com.tairui.gov_affairs_cloud.http.OnError;
|
||||||
import com.tairui.gov_affairs_cloud.ui.login.LoginActivity;
|
import com.tairui.gov_affairs_cloud.ui.login.LoginActivity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.my.entity.UserInfoEntity;
|
import com.tairui.gov_affairs_cloud.ui.my.entity.UserInfoEntity;
|
||||||
@ -38,7 +40,8 @@ public class MyFragment extends BaseFragment<FragmentMyBinding> {
|
|||||||
protected void onSingleClick(View v) {
|
protected void onSingleClick(View v) {
|
||||||
MessageDialog.show("安全退出", "确定要退出登录吗?", "确定", "取消")
|
MessageDialog.show("安全退出", "确定要退出登录吗?", "确定", "取消")
|
||||||
.setOkButton((baseDialog, v1) -> {
|
.setOkButton((baseDialog, v1) -> {
|
||||||
Hawk.put("token","");
|
Hawk.delete(Constant.TOKEN);
|
||||||
|
Hawk.delete(Constant.USER_INFO);
|
||||||
IntentUtil.startActivity(mContext, LoginActivity.class, null);
|
IntentUtil.startActivity(mContext, LoginActivity.class, null);
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
return false;
|
return false;
|
||||||
@ -49,10 +52,21 @@ public class MyFragment extends BaseFragment<FragmentMyBinding> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onApplyData() {
|
protected void onApplyData() {
|
||||||
|
if (AppConfig.getInstance().getUserInfo() == null) {
|
||||||
|
getUserInfo();
|
||||||
|
} else {
|
||||||
|
UserInfoEntity userInfo = AppConfig.getInstance().getUserInfo();
|
||||||
|
initView(userInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getUserInfo() {
|
||||||
RxHttp.get(Api.USER_INFO)
|
RxHttp.get(Api.USER_INFO)
|
||||||
.asResponse(UserInfoEntity.class)
|
.asResponse(UserInfoEntity.class)
|
||||||
.as(RxLife.asOnMain(this))
|
.as(RxLife.asOnMain(this))
|
||||||
.subscribe(data -> {
|
.subscribe(data -> {
|
||||||
|
AppConfig.getInstance().setUserInfo(data);
|
||||||
|
Hawk.put(Constant.USER_INFO, data);
|
||||||
initView(data);
|
initView(data);
|
||||||
}, (OnError) error -> {
|
}, (OnError) error -> {
|
||||||
showToast(error.getErrorMsg());
|
showToast(error.getErrorMsg());
|
||||||
|
@ -24,6 +24,16 @@ public class UserInfoEntity implements Serializable {
|
|||||||
private String email;
|
private String email;
|
||||||
@SerializedName("todoCount")
|
@SerializedName("todoCount")
|
||||||
private Integer todoCount;
|
private Integer todoCount;
|
||||||
|
@SerializedName("admin")
|
||||||
|
private boolean admin;
|
||||||
|
|
||||||
|
public boolean isAdmin() {
|
||||||
|
return admin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdmin(boolean admin) {
|
||||||
|
this.admin = admin;
|
||||||
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return username;
|
return username;
|
||||||
|
@ -9,6 +9,7 @@ import com.tairui.gov_affairs_cloud.R;
|
|||||||
import com.tairui.gov_affairs_cloud.base.BaseFragment;
|
import com.tairui.gov_affairs_cloud.base.BaseFragment;
|
||||||
import com.tairui.gov_affairs_cloud.databinding.FragmentWorkspaceBinding;
|
import com.tairui.gov_affairs_cloud.databinding.FragmentWorkspaceBinding;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.GridInfoActivity;
|
import com.tairui.gov_affairs_cloud.ui.land.GridInfoActivity;
|
||||||
|
import com.tairui.gov_affairs_cloud.ui.land.InspectionListActivity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.LandActivity;
|
import com.tairui.gov_affairs_cloud.ui.land.LandActivity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.LandResouceInfoActivity;
|
import com.tairui.gov_affairs_cloud.ui.land.LandResouceInfoActivity;
|
||||||
import com.tairui.gov_affairs_cloud.ui.land.PlantPlanActivity;
|
import com.tairui.gov_affairs_cloud.ui.land.PlantPlanActivity;
|
||||||
@ -69,6 +70,8 @@ public class WorkSpaceFragment extends BaseFragment<FragmentWorkspaceBinding> {
|
|||||||
IntentUtil.startActivity(mContext, PlantPlanActivity.class);
|
IntentUtil.startActivity(mContext, PlantPlanActivity.class);
|
||||||
} else if (_id == 6) {
|
} else if (_id == 6) {
|
||||||
IntentUtil.startActivity(mContext, LandResouceInfoActivity.class);
|
IntentUtil.startActivity(mContext, LandResouceInfoActivity.class);
|
||||||
|
} else if (_id == 7) {
|
||||||
|
IntentUtil.startActivity(mContext, InspectionListActivity.class);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.tairui.gov_affairs_cloud.util;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import android.text.InputFilter;
|
||||||
|
import android.text.Spanned;
|
||||||
|
|
||||||
|
public class DecimalDigitsInputFilter implements InputFilter {
|
||||||
|
// 正则表达式,用于匹配数字和小数点
|
||||||
|
private Pattern mPattern;
|
||||||
|
|
||||||
|
public DecimalDigitsInputFilter() {
|
||||||
|
// 允许输入数字和最多一个小数点
|
||||||
|
mPattern = Pattern.compile("[0-9]*+(\\.[0-9]*)?");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
|
||||||
|
// 构建输入的文本
|
||||||
|
String newText = dest.subSequence(0, dstart) + source.subSequence(start, end).toString() + dest.subSequence(dend, dest.length());
|
||||||
|
|
||||||
|
// 检查是否符合正则表达式
|
||||||
|
Matcher matcher = mPattern.matcher(newText);
|
||||||
|
if (!matcher.matches()) {
|
||||||
|
// 不符合规则,返回空字符串,即不接受输入
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 符合规则,允许输入
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<solid android:color="#F8F8F8" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="2dp"
|
||||||
|
android:bottomRightRadius="2dp"
|
||||||
|
android:topLeftRadius="2dp"
|
||||||
|
android:topRightRadius="2dp" />
|
||||||
|
</shape>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="2dp"
|
||||||
|
android:bottomRightRadius="2dp"
|
||||||
|
android:topLeftRadius="2dp"
|
||||||
|
android:topRightRadius="2dp" />
|
||||||
|
|
||||||
|
<solid android:color="#DFF9E4" />
|
||||||
|
</shape>
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<solid android:color="#FFF2DE" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="2dp"
|
||||||
|
android:bottomRightRadius="2dp"
|
||||||
|
android:topLeftRadius="2dp"
|
||||||
|
android:topRightRadius="2dp" />
|
||||||
|
</shape>
|
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="2dp"
|
||||||
|
android:bottomRightRadius="2dp"
|
||||||
|
android:topLeftRadius="2dp"
|
||||||
|
android:topRightRadius="2dp" />
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="#EDEDED" />
|
||||||
|
</shape>
|
@ -56,46 +56,6 @@
|
|||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp">
|
android:paddingRight="16dp">
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/layoutRegion"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_marginTop="12dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="left|center_vertical"
|
|
||||||
android:text="所属行政区域"
|
|
||||||
android:textColor="@color/color_tv_titile"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvRegion"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="right|center_vertical"
|
|
||||||
android:layout_marginRight="18dp"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:hint="请选择"
|
|
||||||
android:textColor="@color/color_txt_black"
|
|
||||||
android:textColorHint="@color/color_txt_label"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="18dp"
|
|
||||||
android:layout_height="18dp"
|
|
||||||
android:layout_gravity="right|center_vertical"
|
|
||||||
android:src="@mipmap/ic_arrow_right_gray" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:background="#EDEDED" />
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/layoutGrid"
|
android:id="@+id/layoutGrid"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
262
app/src/main/res/layout/activity_edit_plant_actual.xml
Normal file
262
app/src/main/res/layout/activity_edit_plant_actual.xml
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
<?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/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize">
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnBack"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_back_black"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="填写实际种植情况"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnSubmit"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_gou"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="所属网格"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvGrid"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="计划名称"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/inputPlanName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="种植作物"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCrops"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="面积"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/inputArea"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layoutMonth"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="种植月份"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvMonth"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:src="@mipmap/ic_arrow_right_gray" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layoutCycle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="生长周期"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCycle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:src="@mipmap/ic_arrow_right_gray" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
262
app/src/main/res/layout/activity_edit_plant_plan.xml
Normal file
262
app/src/main/res/layout/activity_edit_plant_plan.xml
Normal file
@ -0,0 +1,262 @@
|
|||||||
|
<?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/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize">
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnBack"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_back_black"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="编辑种植计划"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnSubmit"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_gou"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="所属网格"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvGrid"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="计划名称"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/inputPlanName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="种植作物"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCrops"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="面积"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/inputArea"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layoutMonth"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="种植月份"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvMonth"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:src="@mipmap/ic_arrow_right_gray" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layoutCycle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="生长周期"
|
||||||
|
android:textColor="@color/color_tv_titile"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCycle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:layout_marginRight="18dp"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:src="@mipmap/ic_arrow_right_gray" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
342
app/src/main/res/layout/activity_inspection_detail.xml
Normal file
342
app/src/main/res/layout/activity_inspection_detail.xml
Normal file
@ -0,0 +1,342 @@
|
|||||||
|
<?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/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize">
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnBack"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_back_black"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="土地巡查"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnDelete"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_cancel"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="任务信息"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskStatus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
tools:text="已撤销"
|
||||||
|
android:textColor="@color/color_txt_label"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="任务编号"
|
||||||
|
android:textColor="@color/color_tv_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskCode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入"
|
||||||
|
tools:text="241012001"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="任务名称"
|
||||||
|
android:textColor="@color/color_tv_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
tools:text="土地生产资料巡查"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="任务成员"
|
||||||
|
android:textColor="@color/color_tv_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskMembers"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:background="@color/transparent"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
tools:text="赵雨 周乐"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layoutMonth"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="巡查类型"
|
||||||
|
android:textColor="@color/color_tv_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskType"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
tools:text="定期巡查"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="巡查对象"
|
||||||
|
android:textColor="@color/color_tv_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskTarget"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择"
|
||||||
|
tools:text="耿马镇全部地块"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:src="@mipmap/ic_arrow_right_gray" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#EDEDED" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layoutCycle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|center_vertical"
|
||||||
|
android:text="巡查注意事项"
|
||||||
|
android:textColor="@color/color_tv_content"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskNotes"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_container_white_raduis_5_border"
|
||||||
|
android:hint="请选择"
|
||||||
|
android:minHeight="120dp"
|
||||||
|
android:padding="6dp"
|
||||||
|
tools:text="是否存在违法占地、乱搭乱建、未批先用、批而未用;是否存在改变土地用途(如耕地改为建设用地);检查耕地是否撂荒、弃耕或非法改变种植结构。"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="62dp"
|
||||||
|
android:layout_marginBottom="30dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btnEdit"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:background="@drawable/bg_container_blue_raduis_5"
|
||||||
|
android:drawableLeft="@mipmap/ic_edit_white"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:paddingLeft="12dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingRight="12dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:text="修改"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintRight_toLeftOf="@id/viewHolder"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/viewHolder"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btnRePublish"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_container_blue_raduis_5"
|
||||||
|
android:drawableLeft="@mipmap/ic_publish_white"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:paddingLeft="12dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingRight="12dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:text="重新发布"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintLeft_toRightOf="@id/viewHolder"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
167
app/src/main/res/layout/activity_inspection_list.xml
Normal file
167
app/src/main/res/layout/activity_inspection_list.xml
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
<?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/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize">
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnBack"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_back_black"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="土地巡查"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/btnSearch"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:src="@mipmap/ic_search"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutRegion"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="left|center_vertical"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:paddingBottom="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:src="@mipmap/ic_location" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvRegion"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="4dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:drawableRight="@mipmap/ic_arrow_down"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="耿马镇白马社区耿马镇白马社区耿马镇白马社区耿马镇白马社区" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutType"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="12dp"
|
||||||
|
android:layout_gravity="right|center_vertical"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvType"
|
||||||
|
android:drawableRight="@mipmap/ic_arrow_down"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="全部"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.tairui.gov_affairs_cloud.widget.RefreshRecyclerView
|
||||||
|
android:id="@+id/refreshRecycler"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/btnAdd"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|bottom"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_marginBottom="56dp"
|
||||||
|
android:clickable="true"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:contentPadding="6dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:src="@mipmap/ic_plus" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:text="新增"
|
||||||
|
android:textColor="@color/color_blue"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -54,16 +54,11 @@
|
|||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layoutRegion"
|
android:id="@+id/layoutRegion"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="left|center_vertical"
|
android:gravity="left|center_vertical"
|
||||||
android:paddingTop="12dp"
|
android:paddingTop="12dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="12dp">
|
||||||
@ -75,39 +70,15 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvRegion"
|
android:id="@+id/tvRegion"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="4dp"
|
|
||||||
android:textColor="@color/color_txt_black"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:text="耿马镇白马社区" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="14dp"
|
|
||||||
android:layout_height="14dp"
|
|
||||||
android:layout_marginLeft="2dp"
|
|
||||||
android:src="@mipmap/ic_arrow_down" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layoutGrid"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="left|center_vertical"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp">
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvGrid"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:textColor="@color/color_txt_black"
|
android:textColor="@color/color_txt_black"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
tools:text="团结村网格1" />
|
tools:text="耿马镇白马社区耿马镇白马社区耿马镇白马社区耿马镇白马社区" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="14dp"
|
android:layout_width="14dp"
|
||||||
@ -117,8 +88,6 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvYear"
|
android:id="@+id/tvYear"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -38,18 +38,12 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/layoutRegion"
|
android:id="@+id/layoutRegion"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="left|center_vertical"
|
android:gravity="left|center_vertical"
|
||||||
android:paddingTop="12dp"
|
android:paddingTop="12dp"
|
||||||
android:paddingBottom="12dp">
|
android:paddingBottom="12dp">
|
||||||
@ -61,39 +55,15 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvRegion"
|
android:id="@+id/tvRegion"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="4dp"
|
|
||||||
android:textColor="@color/color_txt_black"
|
|
||||||
android:textSize="14sp"
|
|
||||||
tools:text="耿马镇白马社区" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="14dp"
|
|
||||||
android:layout_height="14dp"
|
|
||||||
android:layout_marginLeft="2dp"
|
|
||||||
android:src="@mipmap/ic_arrow_down" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/layoutGrid"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="left|center_vertical"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp">
|
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvGrid"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="4dp"
|
android:layout_marginLeft="4dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:textColor="@color/color_txt_black"
|
android:textColor="@color/color_txt_black"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
tools:text="团结村网格1" />
|
tools:text="耿马镇白马社区耿马镇白马社区耿马镇白马社区耿马镇白马社区" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="14dp"
|
android:layout_width="14dp"
|
||||||
@ -103,8 +73,6 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
94
app/src/main/res/layout/item_inspection.xml
Normal file
94
app/src/main/res/layout/item_inspection.xml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout 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="120dp"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="土地生产资料巡检"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tvTaskCode"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvStatus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/bg_container_light_green_raduis_2"
|
||||||
|
android:padding="6dp"
|
||||||
|
android:text="待发布"
|
||||||
|
android:textColor="@color/color_txt_green"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/tvName"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/tvName" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvType"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:background="@drawable/bg_container_white_raduis_2_gray_border"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:text="定期巡查"
|
||||||
|
android:textColorHint="@color/color_txt_label"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/tvName"
|
||||||
|
app:layout_constraintLeft_toRightOf="@id/tvName"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/tvName" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskCode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="任务编号:20250501"
|
||||||
|
android:textColor="@color/color_txt_black"
|
||||||
|
android:textSize="15sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tvTaskMembers"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvName" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskMembers"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/ic_member"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:text="张三,李清"
|
||||||
|
android:textColor="@color/color_txt_label"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvTaskCode" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTaskTarget"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="12dp"
|
||||||
|
android:drawableLeft="@mipmap/ic_location_small"
|
||||||
|
android:drawablePadding="4dp"
|
||||||
|
android:text="张三,李清"
|
||||||
|
android:textColor="@color/color_txt_label"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/tvTaskMembers"
|
||||||
|
app:layout_constraintLeft_toRightOf="@id/tvTaskMembers"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/tvTaskMembers" />
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:background="#F7F7F7"
|
||||||
|
app:layout_constraintTop_toBottomOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
app/src/main/res/mipmap-xxhdpi/ic_cancel.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_cancel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_edit_white.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_edit_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 834 B |
BIN
app/src/main/res/mipmap-xxhdpi/ic_location_small.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_location_small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_member.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_member.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_publish_white.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_publish_white.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@ -9,6 +9,8 @@
|
|||||||
<color name="color_tv_titile">#35353F</color>
|
<color name="color_tv_titile">#35353F</color>
|
||||||
<color name="color_tv_content">#666666</color>
|
<color name="color_tv_content">#666666</color>
|
||||||
<color name="color_txt_black">#444444</color>
|
<color name="color_txt_black">#444444</color>
|
||||||
|
<color name="color_txt_blue">@color/color_blue</color>
|
||||||
|
<color name="color_txt_orange">#FFA423</color>
|
||||||
<color name="color_txt_red">#FF4E3D</color>
|
<color name="color_txt_red">#FF4E3D</color>
|
||||||
<color name="color_txt_green">#2AD848</color>
|
<color name="color_txt_green">#2AD848</color>
|
||||||
<color name="color_txt_label">#999999</color>
|
<color name="color_txt_label">#999999</color>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user