|
@@ -71,7 +71,6 @@ import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.Calendar;
|
|
import java.util.Calendar;
|
|
-import java.util.Collections;
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.LinkedList;
|
|
import java.util.LinkedList;
|
|
@@ -109,6 +108,7 @@ public class MyService extends Service {
|
|
private String nextTime;
|
|
private String nextTime;
|
|
private String[] lastTimeSplit;
|
|
private String[] lastTimeSplit;
|
|
private String[] nextTimeSplit;
|
|
private String[] nextTimeSplit;
|
|
|
|
+ public static boolean isLate = true;//记录从后台查询是否过期的情况。
|
|
|
|
|
|
@Nullable
|
|
@Nullable
|
|
@Override
|
|
@Override
|
|
@@ -129,6 +129,8 @@ public class MyService extends Service {
|
|
EventBus.getDefault().register(this);
|
|
EventBus.getDefault().register(this);
|
|
stopRefreshTime();
|
|
stopRefreshTime();
|
|
startRefreshime();
|
|
startRefreshime();
|
|
|
|
+ stopLate();
|
|
|
|
+ startLate();
|
|
}
|
|
}
|
|
|
|
|
|
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
|
|
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
|
|
@@ -363,6 +365,72 @@ public class MyService extends Service {
|
|
}
|
|
}
|
|
//------------------------------------------------------------------------心跳 end---------------------------------
|
|
//------------------------------------------------------------------------心跳 end---------------------------------
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private Timer timerLate;
|
|
|
|
+ private TimerTask taskLate;
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 开始心跳
|
|
|
|
+ */
|
|
|
|
+ private void startLate() {
|
|
|
|
+ timerLate = new Timer();
|
|
|
|
+ taskLate = new TimerTask() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ addSubscription(apiStores.getBackgroundTime(), new ApiCallback<HttpResult<String>>() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onSuccess(HttpResult<String> model) {
|
|
|
|
+ try {
|
|
|
|
+ String timedata = model.getData();
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
+ calendar.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(timedata));
|
|
|
|
+ //第一次就会出现报错。
|
|
|
|
+ Long overdueDate = (Long) Hawk.get(Name.OVERDUE_DATE,0L);//购买的到期的时间
|
|
|
|
+ Long timeInMillis = calendar.getTimeInMillis();//当前时间
|
|
|
|
+ String data = (String) Hawk.get(Name.REMAINING,"0");
|
|
|
|
+ long remaining = Long.valueOf(data);
|
|
|
|
+ Log.d(TAG, "onSuccess: 时间过期remaining" + remaining);
|
|
|
|
+ //如果时间没过期,那么可以继续制作
|
|
|
|
+ if (overdueDate > timeInMillis) {
|
|
|
|
+ Log.d(TAG, "onSuccess: 没有过期");
|
|
|
|
+ isLate = true;
|
|
|
|
+ } else if (remaining > 0) {
|
|
|
|
+ Log.d(TAG, "onSuccess: 时间过期,按次数计算");
|
|
|
|
+ isLate = true;
|
|
|
|
+ } else {
|
|
|
|
+ Log.d(TAG, "onSuccess: 全部过期,全部不能清洗");
|
|
|
|
+ isLate = false;
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ Log.d(TAG, "onSuccess: "+e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onFailure(String msg) {
|
|
|
|
+ isLate = false;
|
|
|
|
+ Log.d(TAG, "onSuccess onFailure: ");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onFinish() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ timerLate.schedule(taskLate, 1000, 1000 * 60 * 2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void stopLate() {
|
|
|
|
+ if (timerLate != null) {
|
|
|
|
+ taskLate.cancel();
|
|
|
|
+ timerLate.cancel();
|
|
|
|
+ timerLate = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
//——-----------------------------------------------------------------------请求 start------------------------------
|
|
//——-----------------------------------------------------------------------请求 start------------------------------
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
public void event(ApiMessageEvent messageEvent) {
|
|
public void event(ApiMessageEvent messageEvent) {
|
|
@@ -382,38 +450,8 @@ public class MyService extends Service {
|
|
/**
|
|
/**
|
|
* 1.首先检查是否过期了,是否有次数
|
|
* 1.首先检查是否过期了,是否有次数
|
|
*/
|
|
*/
|
|
-// isCleaned();//todo 不需要金额也可以清洗
|
|
|
|
- //全蹲位清洗,需要在开机的状态才能执行。
|
|
|
|
- synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
|
|
|
|
- if (MyService.sCleaningLocationList.size() > 0) {//大于0的时候才需要处理。
|
|
|
|
- Integer integer = MyService.sCleaningLocationList.removeFirst();//如果清洗中,那么我们不能全部移除,否则清洗完毕的时候会漏掉一个厕所没有清洗,所以我们留存下来。在假如。
|
|
|
|
- MyService.sCleaningLocationList.clear();
|
|
|
|
- MyService.sCleaningLocationList.addFirst(integer);
|
|
|
|
- }
|
|
|
|
- boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX,null);
|
|
|
|
- if (isSelectCheckBox != null) {
|
|
|
|
- for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
|
|
|
|
- if (!isSelectCheckBox[i - 1]) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
|
|
|
|
- MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!MyService.isCleanOK) {//清洗中,那麼我們就什麼都不做,如果不是清洗中,那麼我們需要進行復位。
|
|
|
|
- //开始清洗。
|
|
|
|
- //EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING,MyService. sCleaningLocationList.getFirst()));
|
|
|
|
- //復位成功後,會自己過去清洗的。所以我們不需要管他。
|
|
|
|
- EventBus.getDefault().post(new ApiMessageEvent(Name.ALLCLEANING, MyService.sCleaningLocationList.getFirst()));
|
|
|
|
- ToastUtil.showToast("开始复位,准备开始全蹲位清洗,如果有人在里面使用,会等待人出来以后进行清洗。");
|
|
|
|
- } else {
|
|
|
|
- ToastUtil.showToast("已添加入清洗队列,等待本次清洗完成后开始清洗");
|
|
|
|
- }
|
|
|
|
|
|
+ isCleaned();//todo 不需要金额也可以清洗
|
|
|
|
|
|
- }
|
|
|
|
break;
|
|
break;
|
|
case "updataParamSet":
|
|
case "updataParamSet":
|
|
if (!PreventSpeedClickUtil.isFastClick()) {
|
|
if (!PreventSpeedClickUtil.isFastClick()) {
|
|
@@ -456,8 +494,8 @@ public class MyService extends Service {
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case Name.SINGLEPOINTCLEANING://单点清洗
|
|
case Name.SINGLEPOINTCLEANING://单点清洗
|
|
- Integer needCleaning = (Integer)messageEvent.getData();
|
|
|
|
- cleanPositionNumX20(needCleaning,5);
|
|
|
|
|
|
+ Integer needCleaning = (Integer) messageEvent.getData();
|
|
|
|
+ cleanPositionNumX20(needCleaning, 5);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
@@ -533,6 +571,7 @@ public class MyService extends Service {
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
//可以清洗机器开始清洗了,向上面报告 0是:定时清洗 1是:随机清洗,暂时只作为上传报告的功能。
|
|
//可以清洗机器开始清洗了,向上面报告 0是:定时清洗 1是:随机清洗,暂时只作为上传报告的功能。
|
|
private void getCleanReport(int i) {
|
|
private void getCleanReport(int i) {
|
|
Map<String, String> params = new HashMap<>();
|
|
Map<String, String> params = new HashMap<>();
|
|
@@ -545,7 +584,7 @@ public class MyService extends Service {
|
|
@Override
|
|
@Override
|
|
public void onSuccess(HttpResult<String> model) {
|
|
public void onSuccess(HttpResult<String> model) {
|
|
Log.d(TAG, "getCleanReportonSuccess: " + model);
|
|
Log.d(TAG, "getCleanReportonSuccess: " + model);
|
|
- /*if ("success".equals(model.getData())) {
|
|
|
|
|
|
+ if ("success".equals(model.getData())) {
|
|
//startClean();
|
|
//startClean();
|
|
//全蹲位清洗,需要在开机的状态才能执行。
|
|
//全蹲位清洗,需要在开机的状态才能执行。
|
|
synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
|
|
synchronized (MyService.sCleaningLocationList) {//多线程操作需要加上同步锁
|
|
@@ -554,7 +593,7 @@ public class MyService extends Service {
|
|
MyService.sCleaningLocationList.clear();
|
|
MyService.sCleaningLocationList.clear();
|
|
MyService.sCleaningLocationList.addFirst(integer);
|
|
MyService.sCleaningLocationList.addFirst(integer);
|
|
}
|
|
}
|
|
- boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX,null);
|
|
|
|
|
|
+ boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX, null);
|
|
if (isSelectCheckBox != null) {
|
|
if (isSelectCheckBox != null) {
|
|
for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
|
|
for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
|
|
if (!isSelectCheckBox[i - 1]) {
|
|
if (!isSelectCheckBox[i - 1]) {
|
|
@@ -562,7 +601,7 @@ public class MyService extends Service {
|
|
}
|
|
}
|
|
MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
|
|
MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
|
|
for (int i = 1; i <= MyService.TOTAL_SUM; i++) {
|
|
MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
|
|
MyService.sCleaningLocationList.addLast(i);//从尾部添加。如果集合中已经存在呢?
|
|
}
|
|
}
|
|
@@ -579,7 +618,7 @@ public class MyService extends Service {
|
|
|
|
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1148,82 +1187,83 @@ public class MyService extends Service {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
} else if (name.equals("X12")) {
|
|
} else if (name.equals("X12")) {
|
|
- String result = AsciiUtils.asciiByteArray2HexStr(responseFrame.getData());
|
|
|
|
- List<String> strList = HexadecimalUtil.getStrList(result, 4);
|
|
|
|
- StringBuilder sb = new StringBuilder();
|
|
|
|
- for (int i = 0, len = strList.size(); i < len; i++) {
|
|
|
|
- String str = strList.get(i);
|
|
|
|
- //2进制
|
|
|
|
- String s3 = HexadecimalUtil.hexStringToByte(str);
|
|
|
|
- //2进制翻转
|
|
|
|
- String s2 = HexadecimalUtil.flipString(s3, 8);
|
|
|
|
- sb.append(s2);
|
|
|
|
- }
|
|
|
|
- List<String> list1 = Arrays.asList(sb.toString().split(""));
|
|
|
|
- ArrayList<String> list2 = new ArrayList(list1);
|
|
|
|
- list2.remove(0);
|
|
|
|
|
|
+ if (isLate) {
|
|
|
|
+ String result = AsciiUtils.asciiByteArray2HexStr(responseFrame.getData());
|
|
|
|
+ List<String> strList = HexadecimalUtil.getStrList(result, 4);
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
+ for (int i = 0, len = strList.size(); i < len; i++) {
|
|
|
|
+ String str = strList.get(i);
|
|
|
|
+ //2进制
|
|
|
|
+ String s3 = HexadecimalUtil.hexStringToByte(str);
|
|
|
|
+ //2进制翻转
|
|
|
|
+ String s2 = HexadecimalUtil.flipString(s3, 8);
|
|
|
|
+ sb.append(s2);
|
|
|
|
+ }
|
|
|
|
+ List<String> list1 = Arrays.asList(sb.toString().split(""));
|
|
|
|
+ ArrayList<String> list2 = new ArrayList(list1);
|
|
|
|
+ list2.remove(0);
|
|
|
|
|
|
- String s = Arrays.toString(list2.toArray());
|
|
|
|
- Log.d(TAG, "X12event1: " + s);
|
|
|
|
- //如果没有开机,那么这里面的代码不会执行。
|
|
|
|
|
|
+ String s = Arrays.toString(list2.toArray());
|
|
|
|
+ Log.d(TAG, "X12event1: " + s);
|
|
|
|
+ //如果没有开机,那么这里面的代码不会执行。
|
|
/* if (!HomeActivity.isStartingUp) {
|
|
/* if (!HomeActivity.isStartingUp) {
|
|
return;
|
|
return;
|
|
}*/
|
|
}*/
|
|
- //监控1号厕所:门锁,以及人体传感器。根据厕所的个数来决定要监听的厕所的个数
|
|
|
|
- boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX, null);
|
|
|
|
- boolean[] isSelectPeopleCheckbox = Hawk.get(Name.ISSELECTPEOPLECHECKBOX, null);
|
|
|
|
|
|
+ //监控1号厕所:门锁,以及人体传感器。根据厕所的个数来决定要监听的厕所的个数
|
|
|
|
+ boolean[] isSelectCheckBox = Hawk.get(Name.ISSELECTCHECKBOX, null);
|
|
|
|
+ boolean[] isSelectPeopleCheckbox = Hawk.get(Name.ISSELECTPEOPLECHECKBOX, null);
|
|
|
|
|
|
- if (isSelectCheckBox == null) {//厕所状态为空,说明还没设置,也就是全部都监听
|
|
|
|
- for (int i = 1; i <= TOTAL_SUM; i++) {//什么都监听
|
|
|
|
- monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
|
|
- bodySensor(i, list2.get(i + 7));
|
|
|
|
- }
|
|
|
|
- } else {//设置过厕所,说明有些不需要监听。
|
|
|
|
- for (int i = 1; i <= TOTAL_SUM; i++) {//判断有哪些不需要监听的。
|
|
|
|
- //是否监听指定的厕所。
|
|
|
|
- if (!isSelectCheckBox[i - 1]) {//true为选中,false为未选中,不需要监听的,我们就过。
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- //厕所需要监听,那么我们判断她是否监听指定的人体传感器
|
|
|
|
- if (isSelectPeopleCheckbox == null || isSelectPeopleCheckbox[i - 1]) {//为空,说明害没设置,就是全部监听
|
|
|
|
|
|
+ if (isSelectCheckBox == null) {//厕所状态为空,说明还没设置,也就是全部都监听
|
|
|
|
+ for (int i = 1; i <= TOTAL_SUM; i++) {//什么都监听
|
|
monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
bodySensor(i, list2.get(i + 7));
|
|
bodySensor(i, list2.get(i + 7));
|
|
- } else {
|
|
|
|
- monitoring(list2.get(i + 1), i, "0");
|
|
|
|
- bodySensor(i, list2.get(i + 7));
|
|
|
|
|
|
+ }
|
|
|
|
+ } else {//设置过厕所,说明有些不需要监听。
|
|
|
|
+ for (int i = 1; i <= TOTAL_SUM; i++) {//判断有哪些不需要监听的。
|
|
|
|
+ //是否监听指定的厕所。
|
|
|
|
+ if (!isSelectCheckBox[i - 1]) {//true为选中,false为未选中,不需要监听的,我们就过。
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //厕所需要监听,那么我们判断她是否监听指定的人体传感器
|
|
|
|
+ if (isSelectPeopleCheckbox == null || isSelectPeopleCheckbox[i - 1]) {//为空,说明害没设置,就是全部监听
|
|
|
|
+ monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
|
|
+ bodySensor(i, list2.get(i + 7));
|
|
|
|
+ } else {
|
|
|
|
+ monitoring(list2.get(i + 1), i, "0");
|
|
|
|
+ bodySensor(i, list2.get(i + 7));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- /**
|
|
|
|
- * if (isSelectCheckBox == null) {//厕所状态为空,说明还没设置,也就是全部都监听
|
|
|
|
- * for (int i = 1; i <= TOTAL_SUM; i++) {//什么都监听
|
|
|
|
- * monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
|
|
- * bodySensor(i, list2.get(i + 7));
|
|
|
|
- * }
|
|
|
|
- * } else {//设置过厕所,说明有些不需要监听。
|
|
|
|
- * for (int i = 1; i <= TOTAL_SUM; i++) {//判断有哪些不需要监听的。
|
|
|
|
- * //是否监听指定的厕所。
|
|
|
|
- * if (!isSelectCheckBox[i - 1]) {//true为选中,false为未选中,不需要监听的,我们就过。
|
|
|
|
- * continue;
|
|
|
|
- * }
|
|
|
|
- * //厕所需要监听,那么我们判断她是否监听指定的人体传感器
|
|
|
|
- * if (isSelectPeopleCheckbox == null ||isSelectPeopleCheckbox[i-1]) {//为空,说明害没设置,就是全部监听
|
|
|
|
- * monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
|
|
- * bodySensor(i, list2.get(i + 7));
|
|
|
|
- * }else{
|
|
|
|
- * if (!isSelectPeopleCheckbox[i-1]) {//true为选中,false为未选中,未选中就是不监听。
|
|
|
|
- * monitoring(list2.get(i + 1), i, "0");
|
|
|
|
- * bodySensor(i, list2.get(i + 7));
|
|
|
|
- * continue;
|
|
|
|
- * }
|
|
|
|
- * }
|
|
|
|
- *
|
|
|
|
- * }
|
|
|
|
- * }
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
- //监控1号厕所:门锁,以及人体传感器。
|
|
|
|
|
|
+ /**
|
|
|
|
+ * if (isSelectCheckBox == null) {//厕所状态为空,说明还没设置,也就是全部都监听
|
|
|
|
+ * for (int i = 1; i <= TOTAL_SUM; i++) {//什么都监听
|
|
|
|
+ * monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
|
|
+ * bodySensor(i, list2.get(i + 7));
|
|
|
|
+ * }
|
|
|
|
+ * } else {//设置过厕所,说明有些不需要监听。
|
|
|
|
+ * for (int i = 1; i <= TOTAL_SUM; i++) {//判断有哪些不需要监听的。
|
|
|
|
+ * //是否监听指定的厕所。
|
|
|
|
+ * if (!isSelectCheckBox[i - 1]) {//true为选中,false为未选中,不需要监听的,我们就过。
|
|
|
|
+ * continue;
|
|
|
|
+ * }
|
|
|
|
+ * //厕所需要监听,那么我们判断她是否监听指定的人体传感器
|
|
|
|
+ * if (isSelectPeopleCheckbox == null ||isSelectPeopleCheckbox[i-1]) {//为空,说明害没设置,就是全部监听
|
|
|
|
+ * monitoring(list2.get(i + 1), i, list2.get(i + 7));
|
|
|
|
+ * bodySensor(i, list2.get(i + 7));
|
|
|
|
+ * }else{
|
|
|
|
+ * if (!isSelectPeopleCheckbox[i-1]) {//true为选中,false为未选中,未选中就是不监听。
|
|
|
|
+ * monitoring(list2.get(i + 1), i, "0");
|
|
|
|
+ * bodySensor(i, list2.get(i + 7));
|
|
|
|
+ * continue;
|
|
|
|
+ * }
|
|
|
|
+ * }
|
|
|
|
+ *
|
|
|
|
+ * }
|
|
|
|
+ * }
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ //监控1号厕所:门锁,以及人体传感器。
|
|
/* monitoring(list2.get(2), 1, list2.get(8));
|
|
/* monitoring(list2.get(2), 1, list2.get(8));
|
|
//监控2号厕所
|
|
//监控2号厕所
|
|
monitoring(list2.get(3), 2, list2.get(9));
|
|
monitoring(list2.get(3), 2, list2.get(9));
|
|
@@ -1237,7 +1277,7 @@ public class MyService extends Service {
|
|
monitoring(list2.get(7), 6, "0" );*/
|
|
monitoring(list2.get(7), 6, "0" );*/
|
|
|
|
|
|
|
|
|
|
- //监控1号厕所
|
|
|
|
|
|
+ //监控1号厕所
|
|
/* bodySensor(1, list2.get(8));
|
|
/* bodySensor(1, list2.get(8));
|
|
//监控2号厕所
|
|
//监控2号厕所
|
|
bodySensor(2, list2.get(9));
|
|
bodySensor(2, list2.get(9));
|
|
@@ -1249,7 +1289,7 @@ public class MyService extends Service {
|
|
bodySensor(5, list2.get(12));
|
|
bodySensor(5, list2.get(12));
|
|
//监控6号厕所
|
|
//监控6号厕所
|
|
bodySensor(6, list2.get(13));*/
|
|
bodySensor(6, list2.get(13));*/
|
|
-
|
|
|
|
|
|
+ }
|
|
} else if (name.equals("D2")) {
|
|
} else if (name.equals("D2")) {
|
|
String data = String.valueOf(HexadecimalUtil.hex2dec(HexadecimalUtil.flipString(AsciiUtils.asciiByteArray2HexStr(responseFrame.getData())).get(0)));
|
|
String data = String.valueOf(HexadecimalUtil.hex2dec(HexadecimalUtil.flipString(AsciiUtils.asciiByteArray2HexStr(responseFrame.getData())).get(0)));
|
|
// Log.d(TAG, "addCleanTimeD2event: " + data);
|
|
// Log.d(TAG, "addCleanTimeD2event: " + data);
|
|
@@ -1419,14 +1459,14 @@ public class MyService extends Service {
|
|
boolean isLastTime = false;
|
|
boolean isLastTime = false;
|
|
boolean isNextTime = false;
|
|
boolean isNextTime = false;
|
|
for (int i = 1; i < lastTimeSplit.length; i++) {
|
|
for (int i = 1; i < lastTimeSplit.length; i++) {
|
|
- if (last==Integer.valueOf(lastTimeSplit[i])){
|
|
|
|
- isLastTime=true;
|
|
|
|
|
|
+ if (last == Integer.valueOf(lastTimeSplit[i])) {
|
|
|
|
+ isLastTime = true;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (int i = 1; i < nextTimeSplit.length; i++) {
|
|
for (int i = 1; i < nextTimeSplit.length; i++) {
|
|
- if (first==Integer.valueOf(nextTimeSplit[i])){
|
|
|
|
- isNextTime=true;
|
|
|
|
|
|
+ if (first == Integer.valueOf(nextTimeSplit[i])) {
|
|
|
|
+ isNextTime = true;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1636,7 +1676,6 @@ public class MyService extends Service {
|
|
Log.d(TAG, "cleanPositionNumX20厕所: " + number);
|
|
Log.d(TAG, "cleanPositionNumX20厕所: " + number);
|
|
mThreadPoolMyservice.stopWriteDD120();
|
|
mThreadPoolMyservice.stopWriteDD120();
|
|
mThreadPoolMyservice.startWriteDD120("D120", "000" + data);
|
|
mThreadPoolMyservice.startWriteDD120("D120", "000" + data);
|
|
- getCleanReport(1);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private boolean isOpenReadWarring = true;
|
|
private boolean isOpenReadWarring = true;
|