采集记录页去掉spinner,列表去掉删除,及获取数据的sql修改;放样点库去掉新建、测量点库去掉删除

main
chenglifeng 6 months ago
parent 3b85a43146
commit 928fae5d82
  1. 2
      app/src/main/java/com/project/survey/App.kt
  2. 5
      app/src/main/java/com/project/survey/ui/instrument/setupstation/CoordinatePointsLibraryActivity.java
  3. 1
      app/src/main/java/com/project/survey/ui/instrument/setupstation/StakingNewJobActivity.java
  4. 2
      app/src/main/java/com/project/survey/ui/lofting/pointlofting/PointStakingActivity.java
  5. 226
      app/src/main/java/com/project/survey/ui/lofting/pointlofting/record/RecordsActivity.java
  6. 3
      app/src/main/java/com/project/survey/ui/lofting/pointlofting/record/util/IRecordsUtils.java
  7. 70
      app/src/main/java/com/project/survey/ui/lofting/pointlofting/record/util/PointStakeListUtils.java
  8. 26
      app/src/main/java/com/project/survey/util/Utils.java
  9. 1
      app/src/main/res/layout/activity_coordinate_points_library.xml
  10. 55
      app/src/main/res/layout/activity_records.xml
  11. 6
      app/src/main/res/layout/dialog_records_filter.xml

@ -41,7 +41,7 @@ class App : SurveyorApp() {
} }
var lastRecordBrowseType: Int = 0 // var lastRecordBrowseType: Int = 0
private val coordinatorSystemNotifier = CoordinatorSystemNotifierImpl() private val coordinatorSystemNotifier = CoordinatorSystemNotifierImpl()
override fun onCreate() { override fun onCreate() {

@ -251,6 +251,7 @@ public class CoordinatePointsLibraryActivity extends BaseSurveyNewActivity {
EditCoordinatePointActivity.start(launcher, CoordinatePointsLibraryActivity.this, selItem.get(0).id); EditCoordinatePointActivity.start(launcher, CoordinatePointsLibraryActivity.this, selItem.get(0).id);
}); });
binding.pointsLibraryBtnDelete.setVisibility(View.GONE);
binding.pointsLibraryBtnDelete.setOnClickListener(v -> { binding.pointsLibraryBtnDelete.setOnClickListener(v -> {
List<PointRecord> selItem = coordinatePointLibraryAdapter.getSelItem(); List<PointRecord> selItem = coordinatePointLibraryAdapter.getSelItem();
if (selItem == null || selItem.size() == 0) { if (selItem == null || selItem.size() == 0) {
@ -326,12 +327,12 @@ public class CoordinatePointsLibraryActivity extends BaseSurveyNewActivity {
if (isSelect) { if (isSelect) {
binding.pointsLibraryBtnConfirm.setVisibility(View.VISIBLE); binding.pointsLibraryBtnConfirm.setVisibility(View.VISIBLE);
binding.pointsLibraryBtnEdit.setVisibility(View.GONE); binding.pointsLibraryBtnEdit.setVisibility(View.GONE);
binding.pointsLibraryBtnDelete.setVisibility(View.GONE); // binding.pointsLibraryBtnDelete.setVisibility(View.GONE);
binding.pointsLibraryBtnExport.setVisibility(View.GONE); binding.pointsLibraryBtnExport.setVisibility(View.GONE);
} else { } else {
binding.pointsLibraryBtnConfirm.setVisibility(View.GONE); binding.pointsLibraryBtnConfirm.setVisibility(View.GONE);
binding.pointsLibraryBtnEdit.setVisibility(View.VISIBLE); binding.pointsLibraryBtnEdit.setVisibility(View.VISIBLE);
binding.pointsLibraryBtnDelete.setVisibility(View.VISIBLE); // binding.pointsLibraryBtnDelete.setVisibility(View.VISIBLE);
binding.pointsLibraryBtnExport.setVisibility(View.VISIBLE); binding.pointsLibraryBtnExport.setVisibility(View.VISIBLE);
} }
} }

@ -203,6 +203,7 @@ public class StakingNewJobActivity extends BaseSurveyNewActivity {
setResult(RESULT_OK, intent); setResult(RESULT_OK, intent);
finish(); finish();
}); });
binding.pointsLibraryBtnNewCreate.setVisibility(View.GONE);
binding.pointsLibraryBtnNewCreate.setOnClickListener(v -> showPointDialog(null, getString(R.string.new_point))); binding.pointsLibraryBtnNewCreate.setOnClickListener(v -> showPointDialog(null, getString(R.string.new_point)));
boolean isSelect = getIntent().getBooleanExtra(KEY_IS_SELECT, true); boolean isSelect = getIntent().getBooleanExtra(KEY_IS_SELECT, true);

@ -233,7 +233,7 @@ public class PointStakingActivity extends BaseSurveyNewActivity {
//放样记录 //放样记录
binding.tvStakingRecord.setOnClickListener(v -> { binding.tvStakingRecord.setOnClickListener(v -> {
stopSoundPool(); stopSoundPool();
RecordsActivity.start(this, RecordTypeConstants.TYPE_POINT_STAKE); RecordsActivity.start(this, workId);
}); });
//仅观测 //仅观测
binding.layoutDragButton.drWatchSurvey.setOnClickListener(v -> watchSurvey()); binding.layoutDragButton.drWatchSurvey.setOnClickListener(v -> watchSurvey());

@ -27,6 +27,7 @@ import com.bingce.data.sync.utils.LoadCurrentProjectIdKt;
import com.bingce.data.sync.utils.LoadCurrentRoadIdKt; import com.bingce.data.sync.utils.LoadCurrentRoadIdKt;
import com.bingce.data.sync.utils.LoadCurrentWaterPipeIdKt; import com.bingce.data.sync.utils.LoadCurrentWaterPipeIdKt;
import com.bingce.data.sync.utils.LoadUserConfigKt; import com.bingce.data.sync.utils.LoadUserConfigKt;
import com.bingce.utils.IntentUtil;
import com.bingce.utils.StringUtil; import com.bingce.utils.StringUtil;
import com.bingce.utils.ThreadPoolUtil; import com.bingce.utils.ThreadPoolUtil;
import com.hjq.permissions.Permission; import com.hjq.permissions.Permission;
@ -71,7 +72,7 @@ public class RecordsActivity extends ColorfulActivity {
private ShapeTextView tv_filter_dcs_type; private ShapeTextView tv_filter_dcs_type;
private ActivityRecordsBinding binding; private ActivityRecordsBinding binding;
private int currentTypeFromSpinner; private int currentTypeFromSpinner = RecordTypeConstants.TYPE_POINT_STAKE;
private final RecordsActivityFilterUtils filterUtils = new RecordsActivityFilterUtils(() -> this, private final RecordsActivityFilterUtils filterUtils = new RecordsActivityFilterUtils(() -> this,
() -> currentTypeFromSpinner, () -> tv_filter_time, () -> tv_filter_dcs_type); () -> currentTypeFromSpinner, () -> tv_filter_time, () -> tv_filter_dcs_type);
private final RecordsActivityExportUtils exportUtils = new RecordsActivityExportUtils(() -> this, () -> currentTypeFromSpinner); private final RecordsActivityExportUtils exportUtils = new RecordsActivityExportUtils(() -> this, () -> currentTypeFromSpinner);
@ -82,6 +83,7 @@ public class RecordsActivity extends ColorfulActivity {
private final RecordsActivityHeaders headers = new RecordsActivityHeaders(() -> this); private final RecordsActivityHeaders headers = new RecordsActivityHeaders(() -> this);
private final RecordsViewModelKt.HolderInActivity holderInActivity = private final RecordsViewModelKt.HolderInActivity holderInActivity =
new RecordsViewModelKt.HolderInActivity(this); new RecordsViewModelKt.HolderInActivity(this);
private String workId = "";
public static void start(Context context, int type) { public static void start(Context context, int type) {
Intent intent = new Intent(context, RecordsActivity.class); Intent intent = new Intent(context, RecordsActivity.class);
@ -94,6 +96,14 @@ public class RecordsActivity extends ColorfulActivity {
context.startActivity(intent); context.startActivity(intent);
} }
private static final String KEY_WORK_ID = "keyWorkId";
public static void start(Context context, String workId) {
Intent intent = new Intent(context, RecordsActivity.class);
intent.putExtra(KEY_WORK_ID, workId);
context.startActivity(intent);
}
@SuppressLint("SourceLockedOrientationActivity") @SuppressLint("SourceLockedOrientationActivity")
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -108,9 +118,13 @@ public class RecordsActivity extends ColorfulActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
binding = ActivityRecordsBinding.inflate(getLayoutInflater()); binding = ActivityRecordsBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); setContentView(binding.getRoot());
setSupportActionBar(binding.toolbarWithOneSpinner); setSupportActionBar(binding.toolbar);
if (getSupportActionBar() != null) if (getSupportActionBar() != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("采集记录");
workId = IntentUtil.stringExtra(this, KEY_WORK_ID);
tv_top_date_filter = findViewById(R.id.activity_records_top_date_filter); tv_top_date_filter = findViewById(R.id.activity_records_top_date_filter);
tv_filter_time = findViewById(R.id.tv_filter_time); tv_filter_time = findViewById(R.id.tv_filter_time);
tv_filter_dcs_type = findViewById(R.id.tv_filter_dcs_type); tv_filter_dcs_type = findViewById(R.id.tv_filter_dcs_type);
@ -126,7 +140,8 @@ public class RecordsActivity extends ColorfulActivity {
tv_filter_dcs_type.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground(); tv_filter_dcs_type.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground();
tv_filter_other.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground(); tv_filter_other.getShapeDrawableBuilder().setSolidColor(Color.WHITE).intoBackground();
} }
initSpinnerType(); // initSpinnerType();
updateRecyclerView();
headers.initHeaders(); headers.initHeaders();
binding.ivOrder.setOnClickListener(view -> { binding.ivOrder.setOnClickListener(view -> {
isSortByTimeAcs = !isSortByTimeAcs; isSortByTimeAcs = !isSortByTimeAcs;
@ -149,110 +164,110 @@ public class RecordsActivity extends ColorfulActivity {
/** /**
* 切换里程坐标等记录类型 * 切换里程坐标等记录类型
*/ */
private void initSpinnerType() { // private void initSpinnerType() {
binding.spinner1.setOnItemSelectedListener(spinnerListener); // binding.spinner1.setOnItemSelectedListener(spinnerListener);
//
List<String> spinnerTitlesList = new ArrayList<>(); // List<String> spinnerTitlesList = new ArrayList<>();
for (Map.Entry<Integer, IRecordsUtils> entry : recordsUtilsMap.entrySet()) { // for (Map.Entry<Integer, IRecordsUtils> entry : recordsUtilsMap.entrySet()) {
if (entry == null) { // if (entry == null) {
continue; // continue;
} // }
IRecordsUtils recordsUtils = entry.getValue(); // IRecordsUtils recordsUtils = entry.getValue();
if (recordsUtils == null) { // if (recordsUtils == null) {
continue; // continue;
} // }
int type = entry.getKey(); // int type = entry.getKey();
String name = recordsUtils.name(); // String name = recordsUtils.name();
switch (type) { // switch (type) {
case RecordTypeConstants.TYPE_CUSTOM_ZHONG_JIAO_ONE: // case RecordTypeConstants.TYPE_CUSTOM_ZHONG_JIAO_ONE:
if (AppChannel.customChannel == AppChannel.CUSTOM_ZJYGJ) { // if (AppChannel.customChannel == AppChannel.CUSTOM_ZJYGJ) {
spinnerTitlesList.add(name);
}
break;
case RecordTypeConstants.TYPE_CUSTOM_TIAN_JING_ONE:
if (AppChannel.customChannel == AppChannel.CUSTOM_CR18SZ) {
spinnerTitlesList.add(name);
}
break;
case RecordTypeConstants.TYPE_CUSTOM_MDM:
if (AppChannel.customChannel == AppChannel.CUSTOM_MONITOR) {
spinnerTitlesList.add(name);
}
break;
// case RecordTypeConstants.TYPE_ROTARY_BRIDGE_6COM:
// if (AppChannel.customChannel == AppChannel.CUSTOM_6_COM) {
// spinnerTitlesList.add(name); // spinnerTitlesList.add(name);
// } // }
// break; // break;
default: // case RecordTypeConstants.TYPE_CUSTOM_TIAN_JING_ONE:
spinnerTitlesList.add(name); // if (AppChannel.customChannel == AppChannel.CUSTOM_CR18SZ) {
break; // spinnerTitlesList.add(name);
} // }
} // break;
// case RecordTypeConstants.TYPE_CUSTOM_MDM:
ArrayAdapter<String> mSpinnerAdapter = new ArrayAdapter<>(this, // if (AppChannel.customChannel == AppChannel.CUSTOM_MONITOR) {
R.layout.spinner_dropdown_item_my_with_background, android.R.id.text1, // spinnerTitlesList.add(name);
spinnerTitlesList); // }
binding.spinner1.setAdapter(mSpinnerAdapter); // break;
//// case RecordTypeConstants.TYPE_ROTARY_BRIDGE_6COM:
//设置默认记录类型 //// if (AppChannel.customChannel == AppChannel.CUSTOM_6_COM) {
int type = App.instance.getLastRecordBrowseType(); //// spinnerTitlesList.add(name);
Intent intent = getIntent(); //// }
if (intent != null && intent.hasExtra(KEY_TYPE)) { //// break;
type = intent.getIntExtra(KEY_TYPE, 0); // default:
} // spinnerTitlesList.add(name);
int lastType = Math.max(type, 0); // break;
// }
IRecordsUtils utils = recordsUtilsMap.get(lastType); // }
int index = 0; //
if (utils != null) { // ArrayAdapter<String> mSpinnerAdapter = new ArrayAdapter<>(this,
String name = utils.name(); // R.layout.spinner_dropdown_item_my_with_background, android.R.id.text1,
boolean found = false; // spinnerTitlesList);
for (index = 0; index < spinnerTitlesList.size(); index++) { // binding.spinner1.setAdapter(mSpinnerAdapter);
if (spinnerTitlesList.get(index).equals(name)) { //
found = true; // //设置默认记录类型
break; // int type = App.instance.getLastRecordBrowseType();
} // Intent intent = getIntent();
} // if (intent != null && intent.hasExtra(KEY_TYPE)) {
if (!found) { // type = intent.getIntExtra(KEY_TYPE, 0);
index = 0; // }
} // int lastType = Math.max(type, 0);
} //
binding.spinner1.setSelection(index); // IRecordsUtils utils = recordsUtilsMap.get(lastType);
} // int index = 0;
// if (utils != null) {
//里程计算坐标等类型切换监听器 // String name = utils.name();
AdapterView.OnItemSelectedListener spinnerListener = new AdapterView.OnItemSelectedListener() { // boolean found = false;
@Override // for (index = 0; index < spinnerTitlesList.size(); index++) {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { // if (spinnerTitlesList.get(index).equals(name)) {
String typeString = binding.spinner1.getSelectedItem().toString(); // found = true;
Set<Map.Entry<Integer, IRecordsUtils>> entries = recordsUtilsMap.entrySet(); // break;
for (Map.Entry<Integer, IRecordsUtils> entry : entries) { // }
if (entry.getValue().name().equals(typeString)) { // }
currentTypeFromSpinner = entry.getKey(); // if (!found) {
if (currentTypeFromSpinner != RecordTypeConstants.TYPE_TUNNEL_BACK_BREAK && currentTypeFromSpinner != RecordTypeConstants.TYPE_WATER_PIPE_BACK_BREAK) { // index = 0;
filterUtils.resetTcsType(); // }
tv_filter_dcs_type.setVisibility(View.GONE); // }
} else { // binding.spinner1.setSelection(index);
tv_filter_dcs_type.setVisibility(View.VISIBLE); // }
}
break; // //里程计算坐标等类型切换监听器
} // AdapterView.OnItemSelectedListener spinnerListener = new AdapterView.OnItemSelectedListener() {
} // @Override
// public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
updateRecyclerView(); // String typeString = binding.spinner1.getSelectedItem().toString();
App.instance.setLastRecordBrowseType(currentTypeFromSpinner); // Set<Map.Entry<Integer, IRecordsUtils>> entries = recordsUtilsMap.entrySet();
SharedPreferences prefs = // for (Map.Entry<Integer, IRecordsUtils> entry : entries) {
PreferenceManager.getDefaultSharedPreferences(RecordsActivity.this); // if (entry.getValue().name().equals(typeString)) {
SharedPreferences.Editor editor = prefs.edit(); // currentTypeFromSpinner = entry.getKey();
editor.putInt("lastRecordBrowseType", App.instance.getLastRecordBrowseType()); // if (currentTypeFromSpinner != RecordTypeConstants.TYPE_TUNNEL_BACK_BREAK && currentTypeFromSpinner != RecordTypeConstants.TYPE_WATER_PIPE_BACK_BREAK) {
editor.apply(); // filterUtils.resetTcsType();
} // tv_filter_dcs_type.setVisibility(View.GONE);
// } else {
@Override // tv_filter_dcs_type.setVisibility(View.VISIBLE);
public void onNothingSelected(AdapterView<?> parent) { // }
} // break;
}; // }
// }
//
// updateRecyclerView();
// App.instance.setLastRecordBrowseType(currentTypeFromSpinner);
// SharedPreferences prefs =
// PreferenceManager.getDefaultSharedPreferences(RecordsActivity.this);
// SharedPreferences.Editor editor = prefs.edit();
// editor.putInt("lastRecordBrowseType", App.instance.getLastRecordBrowseType());
// editor.apply();
// }
//
// @Override
// public void onNothingSelected(AdapterView<?> parent) {
// }
// };
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
@ -332,8 +347,7 @@ public class RecordsActivity extends ColorfulActivity {
IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner); IRecordsUtils recordsUtils = recordsUtilsMap.get(currentTypeFromSpinner);
if (recordsUtils != null) { if (recordsUtils != null) {
recordsUtils.update(binding.recyclerviewRecords, isSortByTimeAcs, recordsUtils.update(binding.recyclerviewRecords, isSortByTimeAcs,
null, SPUtils.INSTANCE.getString(SPConstants.PROJECT_ID, ""), workId,
SPUtils.INSTANCE.getString(SPConstants.PROJECT_ID, ""), "", "",
filterUtils.filterParameter()); filterUtils.filterParameter());
// if (RecordTypeConstants.TYPE_MEASURING_TAPE == currentTypeFromSpinner) { // if (RecordTypeConstants.TYPE_MEASURING_TAPE == currentTypeFromSpinner) {

@ -12,6 +12,9 @@ public interface IRecordsUtils {
UserConfig userConfig, UserConfig userConfig,
String currentProjectId, String currentJobId, String currentRoadId, String currentProjectId, String currentJobId, String currentRoadId,
RecordsActivityFilterParameter parameter); RecordsActivityFilterParameter parameter);
void update(RecyclerView recyclerView, boolean ascOrder,//asc升序 des,降序
String currentProjectId, String currentJobId,
RecordsActivityFilterParameter parameter);
void clearInWorkerThread(RecordsActivityFilterParameter parameter, Runnable completeCallback); void clearInWorkerThread(RecordsActivityFilterParameter parameter, Runnable completeCallback);

@ -89,13 +89,79 @@ class PointStakeListUtils extends AbstractListUtils {
}); });
} }
@Override
public void update(RecyclerView recyclerView, boolean ascOrder, String currentProjectId, String currentJobId, RecordsActivityFilterParameter parameter) {
String pointName = parameter.road;
String k = parameter.k;
String remarks = parameter.remarks;
Date start = parameter.start;
Date end = parameter.end;
SwipeDeletePagingListLayoutHelper.setup(activity(), activity(), recyclerView, callback,
() -> PointStakeDb.getInstance().rawQueryPagingSource(
Utils.findRecordsListByPointNameRemarksDate(
PointStakeConstants.DB_NAME, currentProjectId, currentJobId, ascOrder, pointName, remarks, start, end)),
new SwipeDeletePagingListLayoutHelper.IViewHolder<PointStakeRecord, RecordItemVH>() {
@Override
public int itemViewType(int position) {
return 0;
}
@Override
public void onMenuOpen() {
}
@Override
public void onMenuClosed() {
}
@Override
public boolean isSwipeAble(PointStakeRecord instance) {
return false;
}
@Override
public RecordItemVH newItemContentVH(@NonNull ViewGroup parent, int viewType) {
return new RecordItemVH(RecyclerviewItemRecordsBinding.inflate(getLayoutInflater()));
}
@Override
public void doBindContent(RecordItemVH viewHolder, PointStakeRecord record, int position) {
if (record == null) {
return;
}
String remarks = StringUtil.isEmpty(record.remarks) ? "" : record.remarks;
RecyclerViewItemData data = new RecyclerViewItemData(record.id,
record.pointName,
record.roadName,
Util.formatDouble2StringDotAuto(record.designX),
Util.formatDouble2StringDotAuto(record.designY),
Util.formatDouble2StringDotAuto(record.designZ),
getString(R.string.remarks) + ":" + (remarks.length() > 8 ? remarks.substring(0, 8) + "..." : remarks),
DateUtils.toFull(record.createDate));
viewHolder.doBinder(data);
}
@Override
public void onItemClicked(int index, PointStakeRecord instance) {
RecordDetailActivity.start(activity(), RecordTypeConstants.TYPE_POINT_STAKE, instance.id);
}
@Override
public void onDelete(int index, PointStakeRecord instance, SwipeDeletePagingListLayoutHelper.IOnDeleteListener listener) {
requestDelete(activity(), index, instance.id, listener);
}
});
}
@Override @Override
public void clearInWorkerThread(RecordsActivityFilterParameter parameter, Runnable completeCallback) { public void clearInWorkerThread(RecordsActivityFilterParameter parameter, Runnable completeCallback) {
String projectId = CachedCurrentProject.currentProjectId(); String projectId = CachedCurrentProject.currentProjectId();
String jobId = CachedCurrentJob.currentJobId(projectId); String jobId = CachedCurrentJob.currentJobId(projectId);
List<PointStakeRecord> records = PointStakeDb.getInstance().rawQueryListData( List<PointStakeRecord> records = PointStakeDb.getInstance().rawQueryListData(
Utils.findRecordsListByRoadNameKRemarksDate( Utils.findRecordsListByPointNameRemarksDate(
PointStakeConstants.DB_NAME, projectId, jobId, false, parameter.road, parameter.k, parameter.remarks, parameter.start, parameter.end)); PointStakeConstants.DB_NAME, projectId, jobId, false, parameter.road, parameter.remarks, parameter.start, parameter.end));
PointStakeDb.getInstance().delete(records); PointStakeDb.getInstance().delete(records);
// activity().runOnUiThread(mProgressDialog::dismiss); // activity().runOnUiThread(mProgressDialog::dismiss);
if (completeCallback != null) { if (completeCallback != null) {

@ -6,6 +6,7 @@ import androidx.sqlite.db.SimpleSQLiteQuery;
import com.bingce.data.database.DBQueryConstant; import com.bingce.data.database.DBQueryConstant;
import com.bingce.data.surveyor.BCSurveyWithDeviceInfoRecord; import com.bingce.data.surveyor.BCSurveyWithDeviceInfoRecord;
import com.bingce.utils.RoomFilterBuilder;
import com.project.survey.App; import com.project.survey.App;
import java.util.Date; import java.util.Date;
@ -45,6 +46,31 @@ public class Utils {
} }
} }
public static SimpleSQLiteQuery findRecordsListByPointNameRemarksDate(
String DB_NAME, String projectId, String jobId, boolean ascOrder,//asc升序 des,降序
String pointName, String remarks, Date start, Date end) {
StringBuilder stringBuilder = (new StringBuilder("SELECT * FROM ")).append(DB_NAME);
stringBuilder.append(" WHERE ").append(" (BC_DELETE != 1 ) ");
boolean filtered = RoomFilterBuilder.appendEqualsFilter(true, stringBuilder, "project_id", projectId);
filtered = RoomFilterBuilder.appendEqualsFilter(filtered, stringBuilder, "work_id", jobId);
filtered = RoomFilterBuilder.appendLikesFilter(filtered, stringBuilder, "pointName", pointName);
filtered = RoomFilterBuilder.appendLikesFilter(filtered, stringBuilder, "remarks", remarks);
RoomFilterBuilder.appendBetweenDate(filtered, stringBuilder, "create_date", start, end);
RoomFilterBuilder.appendDateOrder(stringBuilder, "create_date", ascOrder);
return new SimpleSQLiteQuery(stringBuilder.toString());
// StringBuilder stringBuilder = (new StringBuilder("SELECT * FROM ")).append(DB_NAME);
// stringBuilder.append(" WHERE ").append(" (BC_DELETE != 1 ) ");
// boolean filtered = RoomFilterBuilder.appendEqualsFilter(true, stringBuilder, "work_id", jobId);
// filtered = RoomFilterBuilder.appendLikesFilter(filtered, stringBuilder, "road_name", roadName);
// filtered = RoomFilterBuilder.appendLikesFilter(filtered, stringBuilder, "k", k);
// filtered = RoomFilterBuilder.appendLikesFilter(filtered, stringBuilder, "remarks", remarks);
// RoomFilterBuilder.appendBetweenDate(filtered, stringBuilder, "create_date", start, end);
// RoomFilterBuilder.appendDateOrder(stringBuilder, "create_date", ascOrder);
// return new SimpleSQLiteQuery(stringBuilder.toString());
}
public static SimpleSQLiteQuery findRecordsListByRoadNameKRemarksDate( public static SimpleSQLiteQuery findRecordsListByRoadNameKRemarksDate(
String DB_NAME, String projectId, String jobId, boolean ascOrder,//asc升序 des,降序 String DB_NAME, String projectId, String jobId, boolean ascOrder,//asc升序 des,降序
String roadName, String k, String remarks, Date start, Date end, String tcsType) { String roadName, String k, String remarks, Date start, Date end, String tcsType) {

@ -10,6 +10,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:elevation="3dp" android:elevation="3dp"
android:background="@color/white"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">

@ -6,35 +6,42 @@
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar_with_one_spinner" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize" android:layout_height="?android:attr/actionBarSize"
android:background="?colorPrimary" android:background="?colorPrimary"
android:minHeight="?android:attr/actionBarSize" android:minHeight="?android:attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
app:title=""> <!-- <androidx.appcompat.widget.Toolbar-->
<!-- android:id="@+id/toolbar_with_one_spinner"-->
<LinearLayout <!-- android:layout_width="match_parent"-->
android:layout_width="wrap_content" <!-- android:layout_height="?android:attr/actionBarSize"-->
android:layout_height="wrap_content" <!-- android:background="?colorPrimary"-->
android:orientation="horizontal"> <!-- android:minHeight="?android:attr/actionBarSize"-->
<!-- app:popupTheme="@style/ThemeOverlay.AppCompat.Light"-->
<TextView <!-- app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">-->
android:layout_width="wrap_content"
android:layout_height="wrap_content" <!-- <LinearLayout-->
android:text="记录" <!-- android:layout_width="wrap_content"-->
android:textColor="@color/white" <!-- android:layout_height="wrap_content"-->
android:textSize="16sp" /> <!-- android:orientation="horizontal">-->
<androidx.appcompat.widget.AppCompatSpinner <!-- <TextView-->
android:id="@+id/spinner1" <!-- android:layout_width="wrap_content"-->
android:layout_width="wrap_content" <!-- android:layout_height="wrap_content"-->
android:layout_height="match_parent" /> <!-- android:text="记录"-->
</LinearLayout> <!-- android:textColor="@color/white"-->
<!-- android:textSize="16sp" />-->
</androidx.appcompat.widget.Toolbar> <!-- <androidx.appcompat.widget.AppCompatSpinner-->
<!-- android:id="@+id/spinner1"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="match_parent" />-->
<!-- </LinearLayout>-->
<!-- </androidx.appcompat.widget.Toolbar>-->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

@ -93,12 +93,12 @@
android:id="@+id/met_dialog_records_filter_roadname_keyword" android:id="@+id/met_dialog_records_filter_roadname_keyword"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/road_name_keyword" android:hint="点名关键词"
android:textSize="@dimen/myTextSize" android:textSize="@dimen/myTextSize"
app:met_clearButton="true" app:met_clearButton="true"
app:met_floatingLabel="normal" app:met_floatingLabel="normal"
app:met_floatingLabelText="@string/road_name_keyword" app:met_floatingLabelText="点名关键词"
app:met_helperText="@string/road_name_keyword_explain" app:met_helperText="点名里包含关键词"
app:met_helperTextAlwaysShown="false" /> app:met_helperTextAlwaysShown="false" />
<com.rengwuxian.materialedittext.MaterialEditText <com.rengwuxian.materialedittext.MaterialEditText

Loading…
Cancel
Save