|
@@ -48,6 +48,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -261,15 +262,21 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
|
|
|
String[] chargeTypeArray = new String[chargeType.length];
|
|
|
|
|
|
// 仅线上模式
|
|
|
- if (accessType.length == 1 && accessType[0].equals(AccessTypeEnum.Online.getKey())) {
|
|
|
+ if (accessType.length == 1 && Integer.valueOf(accessType[0]).equals(AccessTypeEnum.Online.getKey())) {
|
|
|
product.setOnlyOnline(true);
|
|
|
}
|
|
|
|
|
|
// 产品是否在有效期内 该产品未在有效服务期内,无法使用
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
- if (calendar.after(product.getEndTime())) {
|
|
|
+ Date current = new Date();
|
|
|
+ calendar.setTime(current);
|
|
|
+ Calendar endCalendar = Calendar.getInstance();
|
|
|
+ Calendar startCalendar = Calendar.getInstance();
|
|
|
+ startCalendar.setTime(product.getStartTime());
|
|
|
+ endCalendar.setTime(product.getEndTime());
|
|
|
+ if (calendar.after(endCalendar)) {
|
|
|
product.setIsExpired(true);
|
|
|
- } else if (calendar.before(product.getStartTime())) {
|
|
|
+ } else if (calendar.before(startCalendar)) {
|
|
|
product.setUnStarted(true);
|
|
|
}
|
|
|
|