Subversion Repositories SmartDukaan

Rev

Rev 26265 | Rev 26320 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26265 Rev 26283
Line 66... Line 66...
66
import com.spice.profitmandi.dao.entity.auth.AuthUser;
66
import com.spice.profitmandi.dao.entity.auth.AuthUser;
67
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
67
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
68
import com.spice.profitmandi.dao.entity.catalog.Item;
68
import com.spice.profitmandi.dao.entity.catalog.Item;
69
import com.spice.profitmandi.dao.entity.catalog.Scheme;
69
import com.spice.profitmandi.dao.entity.catalog.Scheme;
70
import com.spice.profitmandi.dao.entity.cs.Position;
70
import com.spice.profitmandi.dao.entity.cs.Position;
-
 
71
import com.spice.profitmandi.dao.entity.cs.Ticket;
71
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
72
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
72
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
73
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
73
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
74
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
74
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
75
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
75
import com.spice.profitmandi.dao.entity.dtr.RechargeProviderCreditWalletHistory;
76
import com.spice.profitmandi.dao.entity.dtr.RechargeProviderCreditWalletHistory;
76
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
77
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
-
 
78
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
77
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
79
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
78
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
80
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
79
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
81
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
80
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
82
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
81
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
83
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
Line 106... Line 108...
106
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
108
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
107
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
109
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
108
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
110
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
109
import com.spice.profitmandi.dao.repository.cs.CsService;
111
import com.spice.profitmandi.dao.repository.cs.CsService;
110
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
112
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
-
 
113
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
111
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
114
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
112
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
115
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
113
import com.spice.profitmandi.dao.repository.dtr.FranchiseeActivityRepository;
116
import com.spice.profitmandi.dao.repository.dtr.FranchiseeActivityRepository;
114
import com.spice.profitmandi.dao.repository.dtr.FranchiseeVisitRepository;
117
import com.spice.profitmandi.dao.repository.dtr.FranchiseeVisitRepository;
115
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
118
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
Line 180... Line 183...
180
	@Autowired
183
	@Autowired
181
	private AuthRepository authRepository;
184
	private AuthRepository authRepository;
182
 
185
 
183
	@Autowired
186
	@Autowired
184
	private PriceDropService priceDropService;
187
	private PriceDropService priceDropService;
185
	
188
 
186
	@Autowired
189
	@Autowired
187
	private FranchiseeVisitRepository franchiseeVisitRepository;
190
	private FranchiseeVisitRepository franchiseeVisitRepository;
188
	
191
	
189
	@Autowired
192
	@Autowired
190
	private FranchiseeActivityRepository franchiseeActivityRepository;
193
	private FranchiseeActivityRepository franchiseeActivityRepository;
Line 396... Line 399...
396
	private UserCampaignRepository userCampaignRepository;
399
	private UserCampaignRepository userCampaignRepository;
397
 
400
 
398
	@Autowired
401
	@Autowired
399
	private Gson gson;
402
	private Gson gson;
400
 
403
 
-
 
404
	@Autowired
-
 
405
	private TicketRepository ticketRepository;
-
 
406
 
401
	private static final Logger LOGGER = LogManager.getLogger(ScheduledTasks.class);
407
	private static final Logger LOGGER = LogManager.getLogger(ScheduledTasks.class);
402
 
408
 
403
	private String FCM_URL = "https://fcm.googleapis.com/fcm/send";
409
	private String FCM_URL = "https://fcm.googleapis.com/fcm/send";
404
	private String FCM_API_KEY = "AAAASAjNcn4:APA91bG6fWRIgYJI0L9gCjP5ynaXz2hJHYKtD9dfH7Depdv31Nd9APJwhx-OPkAJ1WSz4BGNYG8lHThLFSjDGFxIwUZv241YcAJEGDLgt86mxq9FXJe-yBRu-S0_ZwHqmX-QaVKl5F_A";
410
	private String FCM_API_KEY = "AAAASAjNcn4:APA91bG6fWRIgYJI0L9gCjP5ynaXz2hJHYKtD9dfH7Depdv31Nd9APJwhx-OPkAJ1WSz4BGNYG8lHThLFSjDGFxIwUZv241YcAJEGDLgt86mxq9FXJe-yBRu-S0_ZwHqmX-QaVKl5F_A";
405
 
411
 
Line 2078... Line 2084...
2078
		return response;
2084
		return response;
2079
	}
2085
	}
2080
	
2086
	
2081
	
2087
	
2082
 
2088
 
-
 
2089
	public void ticketClosed() throws Exception {
-
 
2090
 
-
 
2091
		List<Ticket> tickets = ticketRepository.selectAllNotClosedTicketsWithStatus(ActivityType.RESOLVED);
-
 
2092
		for (Ticket ticket : tickets) {
-
 
2093
			if (ticket.getUpdateTimestamp().toLocalDate().isBefore(LocalDate.now().minusDays(7))) {
-
 
2094
				ticket.setCloseTimestamp(LocalDateTime.now());
-
 
2095
				ticket.setLastActivity(ActivityType.RESOLVED_ACCEPTED);
-
 
2096
				ticket.setUpdateTimestamp(LocalDateTime.now());
-
 
2097
				ticketRepository.persist(ticket);
-
 
2098
			}
-
 
2099
		}
-
 
2100
 
-
 
2101
	}
-
 
2102
 
2083
}
2103
}
2084
2104