diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 74d6265..dde9c2c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -157,7 +157,7 @@
-
+
{
super.onCreate(savedInstanceState);
setupImmersiveMode();
initView();
+ startService(new Intent(this, DeviceMonitorService.class));
}
private void setupImmersiveMode() {
View decorView = getWindow().getDecorView();
- int flags = View.SYSTEM_UI_FLAG_FULLSCREEN
+
+ // 设置初始全屏标志
+ int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
+ // 隐藏导航栏
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ // 沉浸式模式
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
- }
- decorView.setSystemUiVisibility(flags);
+ decorView.setSystemUiVisibility(uiOptions);
+
+ // 添加监听器,当系统UI可见性变化时重新应用全屏设置
+ decorView.setOnSystemUiVisibilityChangeListener(visibility -> {
+ // 当系统UI可见性变化时,重新设置全屏
+ decorView.setSystemUiVisibility(uiOptions);
+ });
+
+ // 确保Activity的主题也支持全屏
+ getWindow().setFlags(
+ WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN
+ );
+ }
+ @Override
+ protected void onResume() {
+ super.onResume();
+ setupImmersiveMode();
}
-
public void initView() {
initListener();
}
@@ -117,7 +137,7 @@ public class LoginActivity extends BaseActivity {
json.put("code", "");
json.put("phoneUuid", "");
json.put("uuid", "");
- json.put("loginType", "USERNAME_PASSWORD");
+ json.put("loginType", "KITCHEN_PHONE_PASSWORD");
String jsonString = json.toString();
Log.i("getPersonMessage jsonString", jsonString);
// 定义 JSON 的 MediaType
@@ -143,10 +163,10 @@ public class LoginActivity extends BaseActivity {
JSONObject dataJson = JSONObject.parseObject(data);
AppDatabase.getDatabase(this).loginInfoDao().deleteAll();
LoginInfo loginInfo = new LoginInfo();
- loginInfo.setUserName(userName);
+ loginInfo.setUserName(dataJson.getString("staffName"));
loginInfo.setUserPwd(password);
- loginInfo.setUserId("-1"); // 假设用户ID为1,实际应用中应从服务器获取
- loginInfo.setPhone("-1"); // 假设手机号为1234567890,实际应用中应从服务器获取
+ loginInfo.setUserId(dataJson.getString("staffId")); // 假设用户ID为1,实际应用中应从服务器获取
+ loginInfo.setPhone(dataJson.getString("mobile")); // 假设手机号为1234567890,实际应用中应从服务器获取
loginInfo.setToken(dataJson.getString("access_token")); // 假设令牌为sample_token,实际应用中应从服务器获取
AppDatabase.getDatabase(this).loginInfoDao().insert(loginInfo);
//初始化基础数据和设备数据
diff --git a/app/src/main/java/com/bonus/canteen/activity/operation/OutCabinet.java b/app/src/main/java/com/bonus/canteen/activity/operation/OutCabinet.java
index 2e0140c..a88aace 100644
--- a/app/src/main/java/com/bonus/canteen/activity/operation/OutCabinet.java
+++ b/app/src/main/java/com/bonus/canteen/activity/operation/OutCabinet.java
@@ -93,7 +93,7 @@ public class OutCabinet extends BaseActivity {
XUI.initTheme(this);
super.onCreate(savedInstanceState);
//设置全屏
- setFullScreen();
+ setupImmersiveMode();
serialPortManger = new SerialPortManger();
recyclerView = findViewById(R.id.list_view);
WidgetUtils.initRecyclerView(recyclerView);
@@ -116,13 +116,37 @@ public class OutCabinet extends BaseActivity {
}
- private void setFullScreen() {
+ private void setupImmersiveMode() {
+ View decorView = getWindow().getDecorView();
+
+ // 设置初始全屏标志
+ int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ // 隐藏导航栏
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ // 沉浸式模式
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+
+ decorView.setSystemUiVisibility(uiOptions);
+
+ // 添加监听器,当系统UI可见性变化时重新应用全屏设置
+ decorView.setOnSystemUiVisibilityChangeListener(visibility -> {
+ // 当系统UI可见性变化时,重新设置全屏
+ decorView.setSystemUiVisibility(uiOptions);
+ });
+
+ // 确保Activity的主题也支持全屏
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
);
}
-
+ @Override
+ protected void onResume() {
+ super.onResume();
+ setupImmersiveMode();
+ }
private void initListener() {
Button selectAllButton = findViewById(R.id.select_all);
Button enterCabinetButton = findViewById(R.id.enter_cabinet);
diff --git a/app/src/main/java/com/bonus/canteen/activity/operation/PutCabinet.java b/app/src/main/java/com/bonus/canteen/activity/operation/PutCabinet.java
index d8ab1fc..8c4e016 100644
--- a/app/src/main/java/com/bonus/canteen/activity/operation/PutCabinet.java
+++ b/app/src/main/java/com/bonus/canteen/activity/operation/PutCabinet.java
@@ -92,7 +92,7 @@ public class PutCabinet extends BaseActivity {
XUI.initTheme(this);
super.onCreate(savedInstanceState);
//设置全屏
- setFullScreen();
+ setupImmersiveMode();
serialPortManger = new SerialPortManger();
recyclerView = findViewById(R.id.list_view);
WidgetUtils.initRecyclerView(recyclerView);
@@ -114,12 +114,37 @@ public class PutCabinet extends BaseActivity {
initListener();
}
- private void setFullScreen() {
+ private void setupImmersiveMode() {
+ View decorView = getWindow().getDecorView();
+
+ // 设置初始全屏标志
+ int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ // 隐藏导航栏
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ // 沉浸式模式
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+
+ decorView.setSystemUiVisibility(uiOptions);
+
+ // 添加监听器,当系统UI可见性变化时重新应用全屏设置
+ decorView.setOnSystemUiVisibilityChangeListener(visibility -> {
+ // 当系统UI可见性变化时,重新设置全屏
+ decorView.setSystemUiVisibility(uiOptions);
+ });
+
+ // 确保Activity的主题也支持全屏
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
);
}
+ @Override
+ protected void onResume() {
+ super.onResume();
+ setupImmersiveMode();
+ }
private void initListener() {
Button selectAllButton = findViewById(R.id.select_all);
Button enterCabinetButton = findViewById(R.id.enter_cabinet);
diff --git a/app/src/main/java/com/bonus/canteen/activity/operation/SampleRetentionRecordActivity.java b/app/src/main/java/com/bonus/canteen/activity/operation/SampleRetentionRecordActivity.java
index deabe45..4473bd6 100644
--- a/app/src/main/java/com/bonus/canteen/activity/operation/SampleRetentionRecordActivity.java
+++ b/app/src/main/java/com/bonus/canteen/activity/operation/SampleRetentionRecordActivity.java
@@ -6,7 +6,6 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
-import android.os.Looper;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -27,12 +26,10 @@ import com.bonus.canteen.activity.SerialPortManger;
import com.bonus.canteen.adapter.KeepSampleRecordAdapter;
import com.bonus.canteen.constants.AppConstants;
import com.bonus.canteen.core.BaseActivity;
-import com.bonus.canteen.db.AppDatabase;
-import com.bonus.canteen.db.entity.base.DeviceInfo;
-import com.bonus.canteen.entity.CanteenBean;
import com.bonus.canteen.entity.KitchenSampleDishesRecord;
import com.bonus.canteen.entity.SaveStatusBean;
-import com.bonus.canteen.entity.StallBean;
+import com.bonus.canteen.entity.SpinnerBean;
+import com.bonus.canteen.utils.DateTimeHelper;
import com.bonus.canteen.utils.OkHttpService;
import com.bonus.canteen.utils.StringHelper;
import com.bonus.canteen.utils.ThreadPoolManager;
@@ -44,6 +41,7 @@ import com.xuexiang.xpage.enums.CoreAnim;
import com.xuexiang.xui.utils.WidgetUtils;
import com.xuexiang.xui.utils.XToastUtils;
import com.xuexiang.xui.widget.picker.widget.TimePickerView;
+import com.xuexiang.xui.widget.picker.widget.builder.TimePickerBuilder;
import org.easydarwin.easypusher.R;
import org.easydarwin.easypusher.databinding.ActivityRecordBinding;
@@ -61,12 +59,7 @@ public class SampleRetentionRecordActivity extends BaseActivity saveStatusBeanList = new ArrayList<>();
- private final Handler mHandler = new Handler(Looper.getMainLooper());
-
private List kitchenSampleDishesRecords = new ArrayList<>();
- private List canteenList = new ArrayList<>();
- private List stallBeanList = new ArrayList<>();
-
private KeepSampleRecordAdapter adapter;
private RecyclerView recyclerView;
private SwipeRefreshLayout swipeRefreshLayout;
@@ -75,7 +68,6 @@ public class SampleRetentionRecordActivity extends BaseActivity {
double temperature = serialPortManger.getTemperature();
@@ -97,21 +90,71 @@ public class SampleRetentionRecordActivity extends BaseActivity {
+ String dayTime = DateTimeHelper.format(date,"yyyy-MM-dd");
+ binding.macQueryTime.setText(dayTime);
+ }).setTimeSelectChangeListener(date -> Log.i("pvTime", "onTimeSelectChanged")).setTitleText("日期选择")
+ .setType(true, true, true, false, false, false)
+ .build();
+ }
+ private void initSpinners() {
+ //设置入库类型选择器
+ List inboundTypes = new ArrayList<>();
+ inboundTypes.add(new SpinnerBean("0", "全部"));
+ inboundTypes.add(new SpinnerBean("1", "未入柜"));
+ inboundTypes.add(new SpinnerBean("2", "在柜"));
+ inboundTypes.add(new SpinnerBean("3", "离柜"));
+ inboundTypes.add(new SpinnerBean("4", "超时自动离柜"));
+ binding.statusSpinner.setItems(inboundTypes);
+ binding.statusSpinner.setOnItemSelectedListener((view12, position, id, item) -> {
+ if (item instanceof SpinnerBean) {
+ SpinnerBean selectedType = (SpinnerBean) item;
+ Log.d(TAG, "Selected Inbound Type: " + selectedType.getName());
+ } else {
+ Log.e(TAG, "Selected item is not a SpinnerBean");
+ }
+ });
+ binding.statusSpinner.setSelectedIndex(0);
+ }
+ private void setupImmersiveMode() {
+ View decorView = getWindow().getDecorView();
- private void setFullScreen() {
+ // 设置初始全屏标志
+ int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ // 隐藏导航栏
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
+ // 沉浸式模式
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+
+ decorView.setSystemUiVisibility(uiOptions);
+
+ // 添加监听器,当系统UI可见性变化时重新应用全屏设置
+ decorView.setOnSystemUiVisibilityChangeListener(visibility -> {
+ // 当系统UI可见性变化时,重新设置全屏
+ decorView.setSystemUiVisibility(uiOptions);
+ });
+
+ // 确保Activity的主题也支持全屏
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
);
}
+ @Override
+ protected void onResume() {
+ super.onResume();
+ setupImmersiveMode();
+ }
private void initSaveStatusList() {
saveStatusBeanList.clear();
saveStatusBeanList.add(new SaveStatusBean("0", "全部"));
- saveStatusBeanList.add(new SaveStatusBean("1", "未入柜"));
- saveStatusBeanList.add(new SaveStatusBean("2", "在柜"));
- saveStatusBeanList.add(new SaveStatusBean("3", "离柜"));
- saveStatusBeanList.add(new SaveStatusBean("4", "超时自动离柜"));
+ saveStatusBeanList.add(new SaveStatusBean("1", "早餐"));
+ saveStatusBeanList.add(new SaveStatusBean("2", "中餐"));
+ saveStatusBeanList.add(new SaveStatusBean("4", "晚餐"));
}
protected void initTitleView() {
@@ -130,8 +173,7 @@ public class SampleRetentionRecordActivity extends BaseActivity mDatePicker.show());
+ binding.macQueryTime.setOnClickListener(v -> mDatePicker.show());
}
private void refresh() {
@@ -187,87 +229,28 @@ public class SampleRetentionRecordActivity extends BaseActivity {
-// CanteenBean canteenBean = canteenList.get(Math.toIntExact(position));
-// Log.e(TAG, "Selected canteen: " + canteenBean.getCanteenName());
-// initStallTab(canteenBean.getCanteenId());
-// });
-// binding.stallSpinner.setOnItemSelectedListener((parent, view, position, id) -> {
-// StallBean stallBean = stallBeanList.get(Math.toIntExact(position));
-// Log.e(TAG, "Selected stall: " + stallBean.getStallName());
-// });
- initSaveStatusSpinner();
- }
-
- protected void initSaveStatusSpinner() {
-// binding.storageStatusSpinner.setItems(saveStatusBeanList);
-// binding.storageStatusSpinner.setOnItemSelectedListener((parent, view, position, id) -> {
-// SaveStatusBean saveStatusBean = saveStatusBeanList.get(Math.toIntExact(position));
-// Log.e(TAG, "Selected storage status: " + saveStatusBean.getName());
-// });
- }
-
- private void initCanteenTab() {
- ThreadPoolManager.getExecutor().execute(() -> {
- canteenList = new ArrayList<>();
- DeviceInfo deviceInfo = AppDatabase.getDatabase(this).deviceInfoDao().getDeviceInfoOne();
- CanteenBean canteenBean = new CanteenBean();
- canteenBean.setCanteenName(deviceInfo.getCanteenName());
- canteenBean.setCanteenId(deviceInfo.getCanteenId());
- canteenList.add(canteenBean);
- runOnUiThread(() -> {
-// binding.canteenSpinner.setItems(canteenList);
- initStallTab(canteenList.get(0).getCanteenId());
- });
- });
- }
-
- private void initStallTab(String canteenId) {
- ThreadPoolManager.getExecutor().execute(() -> {
- try {
- String url = WorkConfig.getBaseUrl() + "/basic_stall/listAll?canteenId=" + canteenId;
- String result = service.httpGet(url, this);
- Log.i(TAG, "result==" + result);
- if (!ObjectUtil.isEmpty(result)) {
- String json = JSONObject.parseObject(result).getString("rows");
- stallBeanList = new Gson().fromJson(json, new TypeToken>() {
- }.getType());
- if (stallBeanList == null) stallBeanList = new ArrayList<>();
- StallBean defaultStall = new StallBean();
- defaultStall.setStallId("0");
- defaultStall.setStallName("全部");
- stallBeanList.add(0, defaultStall);
-// runOnUiThread(() -> binding.stallSpinner.setItems(stallBeanList));
- }
- } catch (Exception e) {
- Log.e(TAG, "Error fetching stall data: " + e.getMessage());
- }
- });
- }
-
protected void loadMoreData() {
String url = WorkConfig.getBaseUrl() + "/kitchen_sample_dishes_record/list?pageNum=" + mCurrentPage + "&pageSize=" + mPageSize;
Log.e(TAG, "loadMoreData url: " + url);
JSONObject json = new JSONObject();
+ String date = binding.macQueryTime.getText().toString();
+ String status = ((SpinnerBean) binding.statusSpinner.getSelectedItem()).getId();
json.put("searchType", 3);
- if (!StringHelper.isEmptyAndNull(binding.etKeyword.getText().toString())) {
- json.put("searchValue", binding.etKeyword.getText().toString());
+ if (!StringHelper.isEmptyAndNull(date)){
+ json.put("startDateTime",date + " 00:00:00");
+ json.put("endDateTime",date + " 23:59:59");
}
+ if (!status.equals("0")){
+ json.put("mealtimeType",status);
+ }
+// if (!StringHelper.isEmptyAndNull(binding.etKeyword.getText().toString())) {
+// json.put("searchValue", binding.etKeyword.getText().toString());
+// }
String jsonString = json.toString();
Log.e(TAG, "loadMoreData jsonString: " + jsonString);
MediaType mediaType = MediaType.parse(AppConstants.MEDIA_TYPE);
@@ -300,35 +283,6 @@ public class SampleRetentionRecordActivity extends BaseActivity moreRecords, int total) {
try {
if (moreRecords != null && !moreRecords.isEmpty()) {
@@ -377,14 +331,4 @@ public class SampleRetentionRecordActivity extends BaseActivity {
-// String dayTime = DateTimeHelper.format(date, "yyyy-MM-dd");
-// binding.macQueryTime.setText(dayTime);
-// }).setTimeSelectChangeListener(date -> Log.i("pvTime", "onTimeSelectChanged"))
-// .setTitleText("日期选择")
-// .setType(true, true, true, false, false, false)
-// .build();
-// }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/bonus/canteen/core/BaseActivity.java b/app/src/main/java/com/bonus/canteen/core/BaseActivity.java
index 035585e..247d2d5 100644
--- a/app/src/main/java/com/bonus/canteen/core/BaseActivity.java
+++ b/app/src/main/java/com/bonus/canteen/core/BaseActivity.java
@@ -67,7 +67,7 @@ public abstract class BaseActivity extends XPageAct
protected void onCreate(Bundle savedInstanceState) {
initStatusBarStyle();
super.onCreate(savedInstanceState);
- registerSlideBack();
+ unregisterSlideBack();
}
/**
diff --git a/app/src/main/java/com/bonus/canteen/entity/SpinnerBean.java b/app/src/main/java/com/bonus/canteen/entity/SpinnerBean.java
new file mode 100644
index 0000000..57a2b5a
--- /dev/null
+++ b/app/src/main/java/com/bonus/canteen/entity/SpinnerBean.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2025 xuexiangjys(xuexiangjys@163.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.bonus.canteen.entity;
+
+import androidx.annotation.NonNull;
+
+public class SpinnerBean {
+ private String id;
+
+ private String name;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public SpinnerBean(String id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+ public SpinnerBean() {
+ }
+ @NonNull
+ @Override
+ public String toString() {
+ return name;
+ }
+}
diff --git a/app/src/main/java/com/bonus/canteen/service/DeviceMonitorService.java b/app/src/main/java/com/bonus/canteen/service/DeviceMonitorService.java
new file mode 100644
index 0000000..85c94f0
--- /dev/null
+++ b/app/src/main/java/com/bonus/canteen/service/DeviceMonitorService.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2025 xuexiangjys(xuexiangjys@163.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.bonus.canteen.service;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
+import android.util.Log;
+
+import androidx.annotation.Nullable;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+// Android Service中创建TCP服务
+public class DeviceMonitorService extends Service {
+ private ServerSocket serverSocket;
+ private boolean isRunning = false;
+ private int port = 8080; // 设置的端口号
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ startTCPServer();
+ return START_STICKY;
+ }
+
+ private void startTCPServer() {
+ new Thread(() -> {
+ try {
+ serverSocket = new ServerSocket(port);
+ isRunning = true;
+
+ Log.d("DeviceMonitor", "TCP服务已启动,端口: " + port);
+
+ while (isRunning) {
+ Socket clientSocket = serverSocket.accept();
+ // 处理客户端连接
+ handleClientConnection(clientSocket);
+ }
+
+ } catch (IOException e) {
+ Log.e("DeviceMonitor", "启动TCP服务失败: " + e.getMessage());
+ // 端口被占用,尝试其他端口
+ tryAlternativePorts();
+ }
+ }).start();
+ }
+
+ private void tryAlternativePorts() {
+ int[] alternativePorts = {8081, 8082, 8000, 8888, 9000};
+ for (int altPort : alternativePorts) {
+ try {
+ this.port = altPort;
+ serverSocket = new ServerSocket(altPort);
+ isRunning = true;
+ Log.d("DeviceMonitor", "TCP服务在备用端口启动: " + altPort);
+ break;
+ } catch (IOException ex) {
+ Log.e("DeviceMonitor", "端口 " + altPort + " 也被占用");
+ }
+ }
+ }
+
+ private void handleClientConnection(Socket clientSocket) {
+ new Thread(() -> {
+ try {
+ // 读取客户端数据
+ BufferedReader reader = new BufferedReader(
+ new InputStreamReader(clientSocket.getInputStream()));
+
+ String request = reader.readLine();
+// Log.d("DeviceMonitor", "收到请求: " + request);
+
+ // 返回响应
+ PrintWriter writer = new PrintWriter(clientSocket.getOutputStream());
+ writer.println("DEVICE_STATUS:ONLINE");
+ writer.flush();
+
+ clientSocket.close();
+ } catch (IOException e) {
+ Log.e("DeviceMonitor", "处理连接错误: " + e.getMessage());
+ }
+ }).start();
+ }
+
+ @Override
+ public void onDestroy() {
+ isRunning = false;
+ try {
+ if (serverSocket != null) {
+ serverSocket.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ super.onDestroy();
+ }
+
+ @Nullable
+ @Override
+ public IBinder onBind(Intent intent) {
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/bonus/canteen/utils/WorkConfig.java b/app/src/main/java/com/bonus/canteen/utils/WorkConfig.java
index 2b37997..295c6e0 100644
--- a/app/src/main/java/com/bonus/canteen/utils/WorkConfig.java
+++ b/app/src/main/java/com/bonus/canteen/utils/WorkConfig.java
@@ -27,13 +27,15 @@ public class WorkConfig {
//本地
// protected static String baseUrl = "http://192.168.116.253:48380/smart-canteen";
// protected static String prefixesUrl = "http://192.168.116.253:48380";
- protected static String baseUrl = "http://192.168.0.244:48380/smart-canteen";
- protected static String prefixesUrl = "http://192.168.0.244:48380";
- protected static String fileUrl = "http://192.168.0.14:9090/lnyst/";
+ protected static String baseUrl = "http://192.168.20.234:48390/smart-canteen";
+ protected static String prefixesUrl = "http://192.168.20.234:48390";
+ // protected static String baseUrl = "http://192.168.0.244:48380/smart-canteen";
+// protected static String prefixesUrl = "http://192.168.0.244:48380";
+ protected static String fileUrl = "http://192.168.20.234:9000/lnyst/";
protected static String updateUrl = "https://www.baidu.com";
- protected static String serverUri = "tcp://192.168.0.244:1883";
- protected static String MqttUserName = "admin";
- protected static String MqttPassWord = "Bonus@admin123!";
+ protected static String serverUri = "tcp://192.168.20.234:1883";
+ protected static String MqttUserName = "guest";
+ protected static String MqttPassWord = "Bonus@Rabbitmq123!";
protected static String APP_ID = "52XE2dQBtdmMsfDMvyKmPCCPyFsc4jvo8TKvAdaYfr28";
protected static String APP_KEY = "9YFPa6eiuNQAFnzJUadn4LaR8w1bcw3a5ZWYZB6FB57Y";
protected static String FACE_PASS_RATE = "0.8";
diff --git a/app/src/main/res/drawable-hdpi/ic_splash_app_logo_xui.png b/app/src/main/res/drawable-hdpi/ic_splash_app_logo_xui.png
index 1f5c884..185cdaa 100644
Binary files a/app/src/main/res/drawable-hdpi/ic_splash_app_logo_xui.png and b/app/src/main/res/drawable-hdpi/ic_splash_app_logo_xui.png differ
diff --git a/app/src/main/res/drawable/edittext_border.xml b/app/src/main/res/drawable/edittext_border.xml
index 286696c..25b08e7 100644
--- a/app/src/main/res/drawable/edittext_border.xml
+++ b/app/src/main/res/drawable/edittext_border.xml
@@ -2,9 +2,8 @@
-
-
+ android:width="1dp"
+ android:color="#fff" />
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_login_logo.png b/app/src/main/res/drawable/ic_login_logo.png
index fe7c15d..8ed56d1 100644
Binary files a/app/src/main/res/drawable/ic_login_logo.png and b/app/src/main/res/drawable/ic_login_logo.png differ
diff --git a/app/src/main/res/drawable/spinner_dropdown_bg.xml b/app/src/main/res/drawable/spinner_dropdown_bg.xml
new file mode 100644
index 0000000..e974a46
--- /dev/null
+++ b/app/src/main/res/drawable/spinner_dropdown_bg.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/spinner_selector.xml b/app/src/main/res/drawable/spinner_selector.xml
new file mode 100644
index 0000000..65247f5
--- /dev/null
+++ b/app/src/main/res/drawable/spinner_selector.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
index 887e66f..a309c6f 100644
--- a/app/src/main/res/layout/activity_login.xml
+++ b/app/src/main/res/layout/activity_login.xml
@@ -84,7 +84,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLength="20"
- android:text="admin"
+ android:text="18158863319"
android:hint="@string/please_enter_username"
android:textColorHint="#999999"
android:inputType="textPersonName"
@@ -120,7 +120,7 @@
android:layout_marginEnd="5dp"
android:inputType="textPassword"
android:paddingLeft="10dp"
- android:text="Bonus$2031" />
+ android:text="Bonus$2025" />
+
+
+
+
- 智慧食堂
+ 智能留样柜
通用浏览器
更多
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 81ed013..abfbe70 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -85,4 +85,12 @@
- 8dp
+