| Line 82... |
Line 82... |
| 82 |
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
|
82 |
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
|
| 83 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
83 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProvider;
|
| 84 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProviderCreditWalletHistory;
|
84 |
import com.spice.profitmandi.dao.entity.dtr.RechargeProviderCreditWalletHistory;
|
| 85 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
85 |
import com.spice.profitmandi.dao.entity.dtr.RechargeTransaction;
|
| 86 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
86 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
| - |
|
87 |
import com.spice.profitmandi.dao.entity.fofo.Customer;
|
| 87 |
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
|
88 |
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
|
| 88 |
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
|
89 |
import com.spice.profitmandi.dao.entity.fofo.FofoLineItem;
|
| 89 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
90 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
| 90 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
91 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
| 91 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
92 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 92 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
93 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 93 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
94 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 94 |
import com.spice.profitmandi.dao.entity.fofo.PartnerProblem;
|
95 |
import com.spice.profitmandi.dao.entity.fofo.PartnerProblem;
|
| - |
|
96 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrder;
|
| - |
|
97 |
import com.spice.profitmandi.dao.entity.fofo.PendingOrderItem;
|
| 95 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
98 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
| - |
|
99 |
import com.spice.profitmandi.dao.entity.fofo.RazorPay;
|
| 96 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
100 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 97 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
101 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
| 98 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
102 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
| 99 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
103 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
| 100 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
104 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| Line 151... |
Line 155... |
| 151 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
155 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| 152 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
156 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 153 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
157 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| 154 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
158 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
| 155 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
159 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| - |
|
160 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderItemRepository;
|
| - |
|
161 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
|
| 156 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
162 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
| - |
|
163 |
import com.spice.profitmandi.dao.repository.fofo.RazorPayRepository;
|
| 157 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
164 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 158 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
165 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| 159 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
166 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
| 160 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
167 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 161 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
|
168 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
|
| Line 164... |
Line 171... |
| 164 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
171 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
| 165 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
172 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 166 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
173 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 167 |
import com.spice.profitmandi.service.NotificationService;
|
174 |
import com.spice.profitmandi.service.NotificationService;
|
| 168 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
175 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| - |
|
176 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
| 169 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
177 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
| 170 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
178 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 171 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
179 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
| 172 |
import com.spice.profitmandi.service.order.OrderService;
|
180 |
import com.spice.profitmandi.service.order.OrderService;
|
| 173 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
181 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| Line 177... |
Line 185... |
| 177 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
185 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 178 |
import com.spice.profitmandi.service.user.RetailerService;
|
186 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 179 |
import com.spice.profitmandi.service.wallet.WalletService;
|
187 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 180 |
|
188 |
|
| 181 |
import in.shop2020.model.v1.order.OrderStatus;
|
189 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 182 |
import in.shop2020.model.v1.order.WalletReferenceType;;
|
190 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| - |
|
191 |
import okhttp3.OkHttpClient;
|
| - |
|
192 |
import okhttp3.Request;
|
| - |
|
193 |
import okhttp3.Response;;
|
| 183 |
|
194 |
|
| 184 |
@Component
|
195 |
@Component
|
| 185 |
@Transactional(rollbackFor = Throwable.class)
|
196 |
@Transactional(rollbackFor = Throwable.class)
|
| 186 |
public class ScheduledTasks {
|
197 |
public class ScheduledTasks {
|
| 187 |
|
198 |
|
| Line 274... |
Line 285... |
| 274 |
@Autowired
|
285 |
@Autowired
|
| 275 |
PriceDropRepository priceDropRepository;
|
286 |
PriceDropRepository priceDropRepository;
|
| 276 |
|
287 |
|
| 277 |
@Autowired
|
288 |
@Autowired
|
| 278 |
private PartnerTypeChangeRepository partnerTypeChangeRepository;
|
289 |
private PartnerTypeChangeRepository partnerTypeChangeRepository;
|
| - |
|
290 |
|
| 279 |
@Autowired
|
291 |
@Autowired
|
| 280 |
private SchemeService schemeService;
|
292 |
private SchemeService schemeService;
|
| 281 |
|
293 |
|
| 282 |
private static final String[] STOCK_AGEING_MAIL_LIST = new String[] { "uday.singh@smartudkaan.com",
|
294 |
private static final String[] STOCK_AGEING_MAIL_LIST = new String[] { "uday.singh@smartudkaan.com",
|
| 283 |
"adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com", "mohinder.mutreja@smartdukaan.com",
|
295 |
"adeel.yazdani@smartdukaan.com", "kamini.sharma@smartdukaan.com", "mohinder.mutreja@smartdukaan.com",
|
| Line 439... |
Line 451... |
| 439 |
private RefferalRepository refferalRepository;
|
451 |
private RefferalRepository refferalRepository;
|
| 440 |
|
452 |
|
| 441 |
@Autowired
|
453 |
@Autowired
|
| 442 |
private PartnerProblemRepository partnerProblemRepository;
|
454 |
private PartnerProblemRepository partnerProblemRepository;
|
| 443 |
|
455 |
|
| - |
|
456 |
@Autowired
|
| - |
|
457 |
private PendingOrderRepository pendingOrderRepository;
|
| - |
|
458 |
|
| - |
|
459 |
@Autowired
|
| - |
|
460 |
private PendingOrderItemRepository pendingOrderItemRepository;
|
| - |
|
461 |
|
| - |
|
462 |
@Autowired
|
| - |
|
463 |
private RazorPayRepository razorPayRepository;
|
| - |
|
464 |
|
| - |
|
465 |
@Value("${razorpay.account.keyId}")
|
| - |
|
466 |
private String keyId;
|
| - |
|
467 |
|
| - |
|
468 |
@Value("${razorpay.account.keySecret}")
|
| - |
|
469 |
private String keySecret;
|
| - |
|
470 |
|
| 444 |
private static final Logger LOGGER = LogManager.getLogger(ScheduledTasks.class);
|
471 |
private static final Logger LOGGER = LogManager.getLogger(ScheduledTasks.class);
|
| 445 |
|
472 |
|
| 446 |
private String FCM_URL = "https://fcm.googleapis.com/fcm/send";
|
473 |
private String FCM_URL = "https://fcm.googleapis.com/fcm/send";
|
| 447 |
private String FCM_API_KEY = "AAAASAjNcn4:APA91bG6fWRIgYJI0L9gCjP5ynaXz2hJHYKtD9dfH7Depdv31Nd9APJwhx-OPkAJ1WSz4BGNYG8lHThLFSjDGFxIwUZv241YcAJEGDLgt86mxq9FXJe-yBRu-S0_ZwHqmX-QaVKl5F_A";
|
474 |
private String FCM_API_KEY = "AAAASAjNcn4:APA91bG6fWRIgYJI0L9gCjP5ynaXz2hJHYKtD9dfH7Depdv31Nd9APJwhx-OPkAJ1WSz4BGNYG8lHThLFSjDGFxIwUZv241YcAJEGDLgt86mxq9FXJe-yBRu-S0_ZwHqmX-QaVKl5F_A";
|
| 448 |
|
475 |
|
| Line 1561... |
Line 1588... |
| 1561 |
// this.sendMailOfHtmlFomat("amit.gupta@smartukaan.com", saleReport, cc,
|
1588 |
// this.sendMailOfHtmlFomat("amit.gupta@smartukaan.com", saleReport, cc,
|
| 1562 |
// subject);
|
1589 |
// subject);
|
| 1563 |
this.sendMailOfHtmlFormat("amit.gupta@smartdukaan.com", statewiseSaleReport, cc, "Statewise" + subject);
|
1590 |
this.sendMailOfHtmlFormat("amit.gupta@smartdukaan.com", statewiseSaleReport, cc, "Statewise" + subject);
|
| 1564 |
}
|
1591 |
}
|
| 1565 |
|
1592 |
|
| - |
|
1593 |
public void checkRazorPayPaymentStatus() throws IOException {
|
| - |
|
1594 |
List<PendingOrder> pendingOrder = pendingOrderRepository
|
| - |
|
1595 |
.selectAllByStatus(com.spice.profitmandi.dao.enumuration.transaction.OrderStatus.PENDING);
|
| - |
|
1596 |
|
| - |
|
1597 |
for (PendingOrder po : pendingOrder) {
|
| - |
|
1598 |
OkHttpClient client = new OkHttpClient();
|
| - |
|
1599 |
|
| - |
|
1600 |
RazorPay razorPay = razorPayRepository.selectByOrdeId(po.getId());
|
| - |
|
1601 |
Request request1 = new Request.Builder()
|
| - |
|
1602 |
.url("https://api.razorpay.com/v1/orders/" + razorPay.getRazorOrderId() + "/payments").get()
|
| - |
|
1603 |
.addHeader(keyId, keySecret).build();
|
| - |
|
1604 |
|
| - |
|
1605 |
Response response = client.newCall(request1).execute();
|
| - |
|
1606 |
|
| - |
|
1607 |
LOGGER.info("response" + response);
|
| - |
|
1608 |
|
| - |
|
1609 |
}
|
| - |
|
1610 |
}
|
| - |
|
1611 |
|
| 1566 |
public static class SaleTargetReportModel {
|
1612 |
public static class SaleTargetReportModel {
|
| 1567 |
private double totalSale;
|
1613 |
private double totalSale;
|
| 1568 |
private long totalQty;
|
1614 |
private long totalQty;
|
| 1569 |
private double past3daysSale;
|
1615 |
private double past3daysSale;
|
| 1570 |
private int fofoId;
|
1616 |
private int fofoId;
|