|
|
@@ -101,7 +101,7 @@ public class GuestCoinManager {
|
|
|
CoinInfoBean coinInfoBean;
|
|
|
// 당일 +휴효 날짜 비교하면 적립 시각(18:00) 만큼 코인의 유효기한이 짧아지므로(1일짜리 코인이라면 24-18=6시간) 유효날짜 +1일로 비교
|
|
|
long todayMillis = Calendar.getInstance().getTimeInMillis();
|
|
|
- Log.e("APP# GuestCoinManager | expireCoin", "|" + "today --------> " + Formatter.format(todayMillis, CoinInfoBean.DATE_PATTERN));
|
|
|
+ Log.d("APP# GuestCoinManager | expireCoin", "|" + "today --------> " + Formatter.format(todayMillis, CoinInfoBean.DATE_PATTERN));
|
|
|
for (int i = len - 1; i >= 0; --i) {
|
|
|
coinInfoBean = list.get(i);
|
|
|
long coinDayMillis = Formatter.dateStringToMillis(CoinInfoBean.DATE_PATTERN, coinInfoBean.getDate());
|
|
|
@@ -113,7 +113,7 @@ public class GuestCoinManager {
|
|
|
coinInfoBean = list.remove(i);
|
|
|
modifyCoin(coinInfoBean.getGoodsAmount(), true);
|
|
|
++isRemoved;
|
|
|
- Log.e("APP# GuestCoinManager | expireCoin", "|" + "removed ==> " + coinInfoBean.toJson());
|
|
|
+ Log.d("APP# GuestCoinManager | expireCoin", "|" + "removed ==> " + coinInfoBean.toJson());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -136,13 +136,13 @@ public class GuestCoinManager {
|
|
|
coinInfoBean = list.get(i);
|
|
|
long coinDayMillis = Formatter.dateStringToMillis(CoinInfoBean.DATE_PATTERN, coinInfoBean.getDate());
|
|
|
long limitDayMillis = TimeUnit.DAYS.toMillis(coinInfoBean.getLimitDays() + 1);
|
|
|
- long targetDayMillis = limitDayMillis - TimeUnit.DAYS.toMillis(day); // 3일 전
|
|
|
+ long targetDayMillis = coinDayMillis + limitDayMillis - TimeUnit.DAYS.toMillis(day + 1); // +1일하여 당일 소멸 코인도 포함 시킴
|
|
|
|
|
|
if (targetDayMillis < todayMillis && coinInfoBean.isNotified() == false/* && todayMillis > targetDayMillis + TimeUnit.DAYS.toMillis(1)*/) {
|
|
|
// 3일 전 이라면
|
|
|
// -> 정확히 3일 남은 시점만 확인하면 2~1일 남은 것 중 알림이 되지 않은 것을 놓칠 수 있다. bean 에 알림을 했는지 표시해서 확인
|
|
|
coinInfoBean.setNotified(true);
|
|
|
- totalCoin = Integer.parseInt(coinInfoBean.getGoodsAmount());
|
|
|
+ totalCoin += Integer.parseInt(coinInfoBean.getGoodsAmount());
|
|
|
Log.d("APP# GuestCoinManager | notifyCoinExtinction", "|" + " totalCoin: " + totalCoin);
|
|
|
Log.d("APP# GuestCoinManager | notifyCoinExtinction", "|" + " coinInfoBean: " + coinInfoBean.toJson());
|
|
|
}
|
|
|
@@ -189,7 +189,7 @@ public class GuestCoinManager {
|
|
|
* @param coinInfoResultBean
|
|
|
*/
|
|
|
private static void saveCoinInfoResultBean(CoinInfoResultBean coinInfoResultBean) {
|
|
|
- Log.e("APP# GuestCoinManager | saveCoinInfoResultBean", "|" + " save ---> " + coinInfoResultBean.toJson());
|
|
|
+ Log.d("APP# GuestCoinManager | saveCoinInfoResultBean", "|" + " save ---> " + coinInfoResultBean.toJson());
|
|
|
SuperModel.getInstance().getPreferences().setGuestCoinList(coinInfoResultBean.toJson());
|
|
|
}
|
|
|
|
|
|
@@ -206,7 +206,7 @@ public class GuestCoinManager {
|
|
|
saveCoinInfoResultBean(manager.getCoinInfoResultBean());
|
|
|
}
|
|
|
|
|
|
- Log.e("APP# GuestCoinManager | getCoinInfoWithExpire", "|" + " guest -> " + manager.getCoinInfoResultBean().toJson());
|
|
|
+ Log.d("APP# GuestCoinManager | getCoinInfoWithExpire", "|" + " guest -> " + manager.getCoinInfoResultBean().toJson());
|
|
|
|
|
|
return manager.getCoinInfoResultBean();
|
|
|
}
|
|
|
@@ -284,8 +284,10 @@ public class GuestCoinManager {
|
|
|
* @param wrapper
|
|
|
*/
|
|
|
public static void notifyCoinExtinction(CoinInfoResultBeanPrivateWrapper wrapper) {
|
|
|
-
|
|
|
GuestCoinManager manager = new GuestCoinManager(wrapper.coinInfoResultBean);
|
|
|
+ // 소멸 코인 처리
|
|
|
+ manager.expireCoin();
|
|
|
+ // 소멸 예정 코인 값
|
|
|
int result = manager.getCoinExtinctionValue(3);
|
|
|
|
|
|
if (result > 0) {
|