Subversion Repositories SmartDukaan

Rev

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

Rev 25759 Rev 25778
Line 62... Line 62...
62
import com.spice.profitmandi.common.util.Utils;
62
import com.spice.profitmandi.common.util.Utils;
63
import com.spice.profitmandi.common.util.Utils.Attachment;
63
import com.spice.profitmandi.common.util.Utils.Attachment;
64
import com.spice.profitmandi.dao.Interface.Campaign;
64
import com.spice.profitmandi.dao.Interface.Campaign;
65
import com.spice.profitmandi.dao.convertor.LocalDateTimeJsonConverter;
65
import com.spice.profitmandi.dao.convertor.LocalDateTimeJsonConverter;
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;
-
 
68
import com.spice.profitmandi.dao.entity.catalog.Item;
67
import com.spice.profitmandi.dao.entity.catalog.Item;
69
import com.spice.profitmandi.dao.entity.catalog.Scheme;
68
import com.spice.profitmandi.dao.entity.catalog.Scheme;
70
import com.spice.profitmandi.dao.entity.cs.Position;
69
import com.spice.profitmandi.dao.entity.cs.Position;
71
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
70
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
72
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
71
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
Line 136... Line 135...
136
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
135
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
137
import com.spice.profitmandi.dao.repository.user.AddressRepository;
136
import com.spice.profitmandi.dao.repository.user.AddressRepository;
138
import com.spice.profitmandi.dao.repository.user.UserRepository;
137
import com.spice.profitmandi.dao.repository.user.UserRepository;
139
import com.spice.profitmandi.service.PartnerInvestmentService;
138
import com.spice.profitmandi.service.PartnerInvestmentService;
140
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
139
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
-
 
140
import com.spice.profitmandi.service.integrations.toffee.model.PremiumCalculationRequestModel;
141
import com.spice.profitmandi.service.inventory.InventoryService;
141
import com.spice.profitmandi.service.inventory.InventoryService;
142
import com.spice.profitmandi.service.order.OrderService;
142
import com.spice.profitmandi.service.order.OrderService;
143
import com.spice.profitmandi.service.pricing.PriceDropService;
143
import com.spice.profitmandi.service.pricing.PriceDropService;
144
import com.spice.profitmandi.service.recharge.provider.OxigenRechargeProviderService;
144
import com.spice.profitmandi.service.recharge.provider.OxigenRechargeProviderService;
145
import com.spice.profitmandi.service.recharge.provider.ThinkWalnutDigitalRechargeProviderService;
145
import com.spice.profitmandi.service.recharge.provider.ThinkWalnutDigitalRechargeProviderService;
Line 147... Line 147...
147
import com.spice.profitmandi.service.slab.TargetSlabService;
147
import com.spice.profitmandi.service.slab.TargetSlabService;
148
import com.spice.profitmandi.service.transaction.TransactionService;
148
import com.spice.profitmandi.service.transaction.TransactionService;
149
import com.spice.profitmandi.service.user.RetailerService;
149
import com.spice.profitmandi.service.user.RetailerService;
150
import com.spice.profitmandi.service.wallet.WalletService;
150
import com.spice.profitmandi.service.wallet.WalletService;
151
 
151
 
152
import in.shop2020.googleadwords.GoogleAdwordsService.getAdwordsAdKeywordByCriterionIdAndAdGroupId_args;
-
 
153
import in.shop2020.model.v1.order.OrderStatus;
152
import in.shop2020.model.v1.order.OrderStatus;
154
import in.shop2020.model.v1.order.WalletReferenceType;
153
import in.shop2020.model.v1.order.WalletReferenceType;;
155
import in.shop2020.model.v1.user.User;;
-
 
156
 
154
 
157
@Component
155
@Component
158
@Transactional(rollbackFor = Throwable.class)
156
@Transactional(rollbackFor = Throwable.class)
159
public class ScheduledTasks {
157
public class ScheduledTasks {
160
 
158
 
Line 1469... Line 1467...
1469
 
1467
 
1470
					if (response.getStatusLine().getStatusCode() == 200) {
1468
					if (response.getStatusLine().getStatusCode() == 200) {
1471
						pushNotification.setSentTimestamp(LocalDateTime.now());
1469
						pushNotification.setSentTimestamp(LocalDateTime.now());
1472
					} else {
1470
					} else {
1473
						pushNotification.setSentTimestamp(LocalDateTime.of(1970, 1, 1, 00, 00));
1471
						pushNotification.setSentTimestamp(LocalDateTime.of(1970, 1, 1, 00, 00));
1474
						LOGGER.info("message" + response);
1472
						LOGGER.info("message" + "not sent");
1475
					}
1473
					}
1476
 
1474
 
1477
				} catch (Exception e) {
1475
				} catch (Exception e) {
1478
					e.printStackTrace();
1476
					e.printStackTrace();
1479
					LOGGER.info("message" + "not sent");
1477
					LOGGER.info("message" + "not sent");
Line 1540... Line 1538...
1540
		 * storeGuyEntry.getValue()); }
1538
		 * storeGuyEntry.getValue()); }
1541
		 */
1539
		 */
1542
	}
1540
	}
1543
 
1541
 
1544
	public void testToffee() throws Exception {
1542
	public void testToffee() throws Exception {
1545
		LOGGER.info("{}", toffeeService.getAuthToken());
1543
		//LOGGER.info("{}", toffeeService.getAuthToken());
1546
		LOGGER.info("{}", toffeeService.getProducts());
1544
		LOGGER.info("{}", toffeeService.getProducts());
1547
		LOGGER.info("{}", toffeeService.getPincodes("36103000PR"));
1545
		//LOGGER.info("{}", toffeeService.getPincodes("36103000PR"));
-
 
1546
		PremiumCalculationRequestModel pcrm = new PremiumCalculationRequestModel();
-
 
1547
		pcrm.setProductDetails("36103000PR");
-
 
1548
		//pcrm.setProductDetails("36103000PR");
-
 
1549
		pcrm.setDurations(Arrays.asList("3 Months", "6 Months", "1 Year"));
-
 
1550
		pcrm.setSumInsured("15000");
-
 
1551
		System.out.println(toffeeService.getPremiumCalculation(pcrm));
1548
	}
1552
	}
1549
 
1553
 
1550
	public void schemeRollback(List<String> schemeIds) throws Exception {
1554
	public void schemeRollback(List<String> schemeIds) throws Exception {
1551
		List<Integer> schemeIdsInt = schemeIds.stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
1555
		List<Integer> schemeIdsInt = schemeIds.stream().map(x -> Integer.parseInt(x)).collect(Collectors.toList());
1552
		Map<Integer, Scheme> schemesMap = schemeRepository.selectBySchemeIds(schemeIdsInt, 0, schemeIds.size()).stream()
1556
		Map<Integer, Scheme> schemesMap = schemeRepository.selectBySchemeIds(schemeIdsInt, 0, schemeIds.size()).stream()