|
|
@@ -65,7 +65,8 @@ public class DepositNoticeUtil {
|
|
|
case 0x01:
|
|
|
if (!StringUtils.isEmpty(result)) {
|
|
|
if (JSON.parseObject(result).getString("resultMsg") != null) {
|
|
|
- Toast.makeText(MyApplication.getInstance(), JSON.parseObject(result).getString("resultMsg"), Toast.LENGTH_LONG).show();
|
|
|
+ //先不提示
|
|
|
+// Toast.makeText(MyApplication.getInstance(), JSON.parseObject(result).getString("resultMsg"), Toast.LENGTH_LONG).show();
|
|
|
return;
|
|
|
} else {
|
|
|
if (!ListUtils.isEmpty(mSureBookModel))
|
|
|
@@ -123,20 +124,21 @@ public class DepositNoticeUtil {
|
|
|
|
|
|
/**
|
|
|
* 判断model里面的数据是否符合提醒条件
|
|
|
+ *
|
|
|
* @param models
|
|
|
*/
|
|
|
public static void isNoticeTimeInMainLooper(List<SureBookModel> models) {
|
|
|
for (SureBookModel model : models) {
|
|
|
LatLng latLng = new LatLng(Double.valueOf(model.getAb_latitude()), Double.valueOf(model.getAb_longitude()));
|
|
|
float distance = BaiduMapUtil.getInstence().autoDistance(latLng);
|
|
|
- if (distance == -1f){
|
|
|
+ if (distance == -1f) {
|
|
|
LogUtil.i("distance == -1f");
|
|
|
continue;
|
|
|
}
|
|
|
- if (model.getAb_starttime().compareTo(TimeUtils.f_long_2_str(System.currentTimeMillis())) > 0){
|
|
|
+ if (model.getAb_starttime().compareTo(TimeUtils.f_long_2_str(System.currentTimeMillis())) > 0) {
|
|
|
setNoticeTime(model.getAb_starttime(), latLng, distance);
|
|
|
}
|
|
|
- LogUtil.prinlnLongMsg("startTime,current_T",model.getAb_starttime()+","+TimeUtils.f_long_2_str(System.currentTimeMillis()));
|
|
|
+ LogUtil.prinlnLongMsg("startTime,current_T", model.getAb_starttime() + "," + TimeUtils.f_long_2_str(System.currentTimeMillis()));
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -148,6 +150,7 @@ public class DepositNoticeUtil {
|
|
|
/**
|
|
|
* 对于符合当前条件的预约,进行提前预约时间计算得出:开始提醒的具体时间点startNoticeTime
|
|
|
* 然后:startNoticeTime <= 当前时间则开始进行通知提醒
|
|
|
+ *
|
|
|
* @param startTime
|
|
|
* @param location
|
|
|
* @param dis
|
|
|
@@ -165,7 +168,7 @@ public class DepositNoticeUtil {
|
|
|
if (dis != 0) {
|
|
|
minTime = (int) (TimeUtils.f_str_2_long(startTime) - (dis / 3) * 1000 - 15 * 60 * 1000);
|
|
|
} else {
|
|
|
- minTime = (int) (TimeUtils.f_str_2_long(startTime) - 800 * 1000-15 * 60 * 1000);
|
|
|
+ minTime = (int) (TimeUtils.f_str_2_long(startTime) - 800 * 1000 - 15 * 60 * 1000);
|
|
|
}
|
|
|
} else {
|
|
|
for (DrivingRouteLine e : list) {
|
|
|
@@ -174,18 +177,18 @@ public class DepositNoticeUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- long startNoticeTime = TimeUtils.f_str_2_long(startTime) - minTime * 1000-15 * 60 * 1000;
|
|
|
+ long startNoticeTime = TimeUtils.f_str_2_long(startTime) - minTime * 1000 - 15 * 60 * 1000;
|
|
|
if (startNoticeTime <= System.currentTimeMillis()) {
|
|
|
//TODO 提醒
|
|
|
- Log.i("notificationManage","开始提醒");
|
|
|
+ Log.i("notificationManage", "开始提醒");
|
|
|
notificationManage.sendNotification(MyApplication.getInstance(),
|
|
|
"您有预约计划即将开始!", BookingListActivity.class);
|
|
|
- }else{
|
|
|
- Log.i("notificationManage","提醒时间不符合");
|
|
|
+ } else {
|
|
|
+ Log.i("notificationManage", "提醒时间不符合");
|
|
|
}
|
|
|
- LogUtil.i("minTime="+minTime);
|
|
|
- LogUtil.i("startNoticeTime="+TimeUtils.f_long_2_str(startNoticeTime));
|
|
|
- LogUtil.i("System.currentTimeMillis()="+TimeUtils.f_long_2_str( System.currentTimeMillis()));
|
|
|
+ LogUtil.i("minTime=" + minTime);
|
|
|
+ LogUtil.i("startNoticeTime=" + TimeUtils.f_long_2_str(startNoticeTime));
|
|
|
+ LogUtil.i("System.currentTimeMillis()=" + TimeUtils.f_long_2_str(System.currentTimeMillis()));
|
|
|
} catch (Exception e) {
|
|
|
if (e != null)
|
|
|
Log.i("setStartime Exception=", e.getMessage() + "");
|