Subversion Repositories SmartDukaan

Rev

Rev 36513 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22550 ashik.ali 1
package com.spice.profitmandi.service.wallet;
2
 
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
34261 tejus.loha 4
import com.spice.profitmandi.common.model.CustomRetailer;
30740 amit.gupta 5
import com.spice.profitmandi.common.model.ProfitMandiConstants;
34261 tejus.loha 6
import com.spice.profitmandi.common.util.FileUtil;
23269 ashik.ali 7
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
25542 amit.gupta 8
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
34261 tejus.loha 9
import com.spice.profitmandi.dao.entity.transaction.AddWalletRequest;
32494 amit.gupta 10
import com.spice.profitmandi.dao.entity.transaction.ManualPaymentType;
22550 ashik.ali 11
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
12
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
34674 aman.kumar 13
import com.spice.profitmandi.dao.entity.user.User;
22550 ashik.ali 14
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
34261 tejus.loha 15
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
16
import com.spice.profitmandi.dao.repository.catalog.AddWalletRequestRepository;
32494 amit.gupta 17
import com.spice.profitmandi.dao.repository.catalog.ManualPaymentRequestRepository;
25542 amit.gupta 18
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
33845 tejus.loha 19
import com.spice.profitmandi.dao.repository.dtr.PartnerOnBoardingPanelRepository;
33172 tejus.loha 20
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
22550 ashik.ali 21
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
22
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
23
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
33845 tejus.loha 24
import com.spice.profitmandi.dao.repository.user.StoreTimelinetbRepository;
34674 aman.kumar 25
import com.spice.profitmandi.dao.repository.user.UserRepository;
30025 amit.gupta 26
import com.spice.profitmandi.service.NotificationService;
30740 amit.gupta 27
import com.spice.profitmandi.service.PartnerInvestmentService;
34261 tejus.loha 28
import com.spice.profitmandi.service.order.OrderService;
29
import com.spice.profitmandi.service.user.RetailerService;
33845 tejus.loha 30
import com.spice.profitmandi.service.user.StoreTimelineTatService;
22857 ashik.ali 31
import in.shop2020.model.v1.order.WalletReferenceType;
30025 amit.gupta 32
import org.apache.logging.log4j.LogManager;
33
import org.apache.logging.log4j.Logger;
34
import org.springframework.beans.factory.annotation.Autowired;
34261 tejus.loha 35
import org.springframework.http.ResponseEntity;
30025 amit.gupta 36
import org.springframework.stereotype.Component;
22857 ashik.ali 37
 
30025 amit.gupta 38
import java.time.LocalDateTime;
39
import java.util.*;
40
import java.util.stream.Collectors;
41
 
22550 ashik.ali 42
@Component
43
public class WalletServiceImpl implements WalletService {
44
 
32494 amit.gupta 45
    private static final Logger LOGGER = LogManager.getLogger(WalletServiceImpl.class);
25395 tejbeer 46
 
32494 amit.gupta 47
    @Autowired
48
    ManualPaymentRequestRepository manualPaymentRequestRepository;
34261 tejus.loha 49
    @Autowired
50
    AddWalletRequestRepository addWalletRequestRepository;
51
    @Autowired
52
    OrderService orderService;
53
    @Autowired
54
    RetailerService retailerService;
33194 amit.gupta 55
    ProfitMandiBusinessException pbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Wallet is under maintainance, please try after some time");
56
    ProfitMandiBusinessException inactivepbse = new ProfitMandiBusinessException("Wallet", "Wallet", "Investment is incomplete, please add amount to wallet to complete the investment");
57
 
32494 amit.gupta 58
    @Autowired
59
    PartnerInvestmentService partnerInvestmentService;
60
    private boolean underMaintainance = false;
61
    @Autowired
62
    private UserAccountRepository userAccountRepository;
33172 tejus.loha 63
 
32494 amit.gupta 64
    @Autowired
65
    private UserWalletRepository userWalletRepository;
66
    @Autowired
67
    private FofoStoreRepository fofoStoreRepository;
68
    @Autowired
69
    private UserWalletHistoryRepository userWalletHistoryRepository;
70
    @Autowired
71
    private NotificationService notificationService;
24739 tejbeer 72
 
33172 tejus.loha 73
    @Autowired
74
    RetailerRepository retailerRepository;
33845 tejus.loha 75
    @Autowired
76
    PartnerOnBoardingPanelRepository partnerOnBoardingPanelRepository;
77
    @Autowired
78
    StoreTimelineTatService storeTimelineTatService;
79
    @Autowired
80
    StoreTimelinetbRepository storeTimelinetbRepository;
33172 tejus.loha 81
 
34674 aman.kumar 82
    @Autowired
83
    UserRepository userRepository;
84
 
32494 amit.gupta 85
    @Override
86
    public void addAmountToWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
87
                                  String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
88
        if (Math.round(amount) == 0)
89
            return;
36372 amit 90
        UserWallet userWallet = userWalletRepository.selectByRetailerIdForUpdate(retailerId);
35828 amit 91
        userWallet.setAmount(userWallet.getAmount() + Math.round(amount));
36513 amit 92
        this.createUserWalletHistory(Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime, userWallet.getAmount());
36305 amit 93
        if (WalletReferenceType.AUTOMATED_ADVANCE.equals(referenceType)
94
                || WalletReferenceType.ADVANCE_AMOUNT.equals(referenceType)
95
                || WalletReferenceType.PAYMENT_GATEWAY.equals(referenceType)
96
                || WalletReferenceType.ONLINE_ORDER_PAYMENT.equals(referenceType)
97
                || WalletReferenceType.PURCHASE.equals(referenceType)) {
98
            partnerInvestmentService.evictInvestmentCache(retailerId);
99
        }
32494 amit.gupta 100
    }
25609 amit.gupta 101
 
32494 amit.gupta 102
    @Override
103
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
104
                                        String description, float amount, LocalDateTime businessTime) throws ProfitMandiBusinessException {
105
        if (underMaintainance) {
106
            throw pbse;
107
        } else if (WalletReferenceType.RECHARGE.equals(referenceType) && !isActive(retailerId)) {
108
            throw inactivepbse;
109
        }
110
        if (amount == 0)
111
            return;
36372 amit 112
        UserWallet userWallet = userWalletRepository.selectByRetailerIdForUpdate(retailerId);
35828 amit 113
        int walletAmount = userWallet.getAmount();
33547 tejus.loha 114
        if (!WalletReferenceType.DAMAGE_PROTECTION.equals(referenceType) && amount > ProfitMandiConstants.MAX_NEGATIVE_WALLET_VALUE && Math.floor(amount) > walletAmount) {
34575 vikas.jang 115
            LOGGER.error("Wallet Balance is insufficient!, needed - {}, wallet has - {}, for retailer - {}", Math.floor(amount), walletAmount, retailerId);
34674 aman.kumar 116
            User user = userRepository.selectById(retailerId);
117
            throw new ProfitMandiBusinessException(user.getName(), walletAmount, "WLT_1000");
32494 amit.gupta 118
        }
119
        userWallet.setAmount(walletAmount - Math.round(amount));
36513 amit 120
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime, userWallet.getAmount());
32494 amit.gupta 121
    }
24739 tejbeer 122
 
32494 amit.gupta 123
    @Override
124
    public void consumeAmountFromWallet(int retailerId, int referenceId, WalletReferenceType referenceType,
125
                                        String description, float amount, LocalDateTime businessTime, boolean forced) throws ProfitMandiBusinessException {
126
        if (underMaintainance) {
127
            throw pbse;
128
        } else if (WalletReferenceType.RECHARGE.equals(referenceType) && !isActive(retailerId)) {
129
            throw inactivepbse;
130
        }
131
        if (amount == 0)
132
            return;
36372 amit 133
        UserWallet userWallet = userWalletRepository.selectByRetailerIdForUpdate(retailerId);
35828 amit 134
        int walletAmount = userWallet.getAmount();
32494 amit.gupta 135
        if (!forced && amount > 2 && amount > walletAmount) {
136
            LOGGER.error("Wallet Balance is insufficient!");
137
            throw new ProfitMandiBusinessException("balance", walletAmount, "WLT_1000");
138
        }
139
        userWallet.setAmount(walletAmount - Math.round(amount));
36513 amit 140
        this.createUserWalletHistory(-Math.round(amount), userWallet.getId(), referenceId, referenceType, description, businessTime, userWallet.getAmount());
32494 amit.gupta 141
    }
24739 tejbeer 142
 
32494 amit.gupta 143
    @Override
144
    public void rollbackAmountFromWallet(int retailerId, float amountToRollback, int rollbackReference,
145
                                         WalletReferenceType walletReferenceType, String rollbackReason, LocalDateTime businessTime) throws ProfitMandiBusinessException {
25542 amit.gupta 146
 
32494 amit.gupta 147
        if (amountToRollback == 0)
148
            return;
36372 amit 149
        UserWallet userWallet = userWalletRepository.selectByRetailerIdForUpdate(retailerId);
35828 amit 150
        int walletAmount = userWallet.getAmount();
32494 amit.gupta 151
        List<UserWalletHistory> uwh = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(rollbackReference, walletReferenceType)
152
                .stream().filter(x -> x.getWalletId() == userWallet.getId()).collect(Collectors.toList());
153
        if (uwh.size() == 0) {
154
            LOGGER.info("Retailer with id {} dont have valid reference {} and reference type {}",
155
                    retailerId, rollbackReference, walletReferenceType);
156
            throw new ProfitMandiBusinessException("Retailer specific wallet entries doesn't exist", retailerId, "Nothing to rollback");
157
        }
158
        userWallet.setAmount(walletAmount - Math.round(amountToRollback));
159
        this.createUserWalletHistory(-Math.round(amountToRollback), userWallet.getId(), rollbackReference,
36513 amit 160
                walletReferenceType, rollbackReason, businessTime, userWallet.getAmount());
32494 amit.gupta 161
        userWalletRepository.persist(userWallet);
24739 tejbeer 162
 
32494 amit.gupta 163
    }
30025 amit.gupta 164
 
32494 amit.gupta 165
    private void createUserWalletHistory(float amount, int walletId, int referenceId, WalletReferenceType referenceType,
36513 amit 166
                                         String description, LocalDateTime businessTimestamp, long walletBalance) {
32494 amit.gupta 167
        if (amount == 0)
168
            return;
169
        UserWalletHistory userWalletHistory = new UserWalletHistory();
170
        userWalletHistory.setWalletId(walletId);
171
        userWalletHistory.setAmount(Math.round(amount));
172
        userWalletHistory.setReference(referenceId);
173
        userWalletHistory.setReferenceType(referenceType);
174
        userWalletHistory.setTimestamp(LocalDateTime.now());
175
        userWalletHistory.setDescription(description);
176
        userWalletHistory.setBusinessTimestamp(businessTimestamp);
36513 amit 177
        userWalletHistory.setRunningBalance(walletBalance);
32494 amit.gupta 178
        userWalletHistoryRepository.persist(userWalletHistory);
179
    }
24739 tejbeer 180
 
32494 amit.gupta 181
    @Override
182
    public UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException {
183
        UserAccount userAccount = userAccountRepository.selectByUserIdType(userId, AccountType.saholic);
23509 amit.gupta 184
 
32494 amit.gupta 185
        if (underMaintainance) {
186
            throw pbse;
187
        }
188
        return userWalletRepository.selectByRetailerId(Integer.valueOf(userAccount.getAccountKey()));
189
    }
30889 amit.gupta 190
 
32494 amit.gupta 191
    @Override
192
    public List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException {
193
        if (underMaintainance || !isActive(userId)) {
194
            throw pbse;
195
        }
196
        UserWallet userWallet = this.getUserWalletByUserId(userId);
197
        List<UserWalletHistory> userWalletHistories = userWalletHistoryRepository.selectByWalletId(userWallet.getId());
198
        return userWalletHistories;
199
    }
25395 tejbeer 200
 
32494 amit.gupta 201
    //Definition is now changed, active also means valid investment should be ok
202
    private boolean isActive(int userId) {
203
        boolean active = true;
204
        try {
205
            FofoStore fs = fofoStoreRepository.selectByRetailerId(userId);
206
            active = fs.isActive() && partnerInvestmentService.isInvestmentOk(userId, ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT);
207
        } catch (Exception e) {
24739 tejbeer 208
 
32494 amit.gupta 209
        }
210
        return active;
211
    }
24739 tejbeer 212
 
32494 amit.gupta 213
    @Override
214
    public List<UserWalletHistory> getUserWalletHistoryByRetailerId(int retailerId)
215
            throws ProfitMandiBusinessException {
216
        if (underMaintainance) {
217
            throw pbse;
218
        }
219
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
220
        return userWalletHistoryRepository.selectByWalletId(userWallet.getId());
221
    }
24739 tejbeer 222
 
32494 amit.gupta 223
    @Override
224
    public long getSizeByRetailerId(int retailerId, LocalDateTime startDateTime, LocalDateTime endDateTime)
225
            throws ProfitMandiBusinessException {
226
        if (underMaintainance) {
227
            throw pbse;
228
        }
229
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
230
        return userWalletHistoryRepository.selectCountByWalletId(userWallet.getId(), startDateTime, endDateTime);
231
    }
25542 amit.gupta 232
 
32494 amit.gupta 233
    @Override
234
    public List<UserWalletHistory> getPaginatedUserWalletHistoryByRetailerId(int retailerId,
235
                                                                             LocalDateTime startDateTime, LocalDateTime endDateTime, int offset, int limit)
236
            throws ProfitMandiBusinessException {
237
        if (underMaintainance) {
238
            throw pbse;
239
        }
240
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
241
        return userWalletHistoryRepository.selectPaginatedByWalletId(userWallet.getId(), startDateTime, endDateTime,
242
                offset, limit);
243
    }
22550 ashik.ali 244
 
32494 amit.gupta 245
    @Override
33247 ranu 246
    public Map<Integer, UserWallet> getRetailerIdUserWalletMap(Set<Integer> retailerIds) throws ProfitMandiBusinessException {
32494 amit.gupta 247
        List<UserWallet> userWallets = userWalletRepository.selectByRetailerIds(retailerIds);
248
        Map<Integer, UserWallet> retailerIdUserWalletMap = new HashMap<>();
249
        for (UserWallet userWallet : userWallets) {
250
            retailerIdUserWalletMap.put(userWallet.getUserId(), userWallet);
251
        }
252
        return retailerIdUserWalletMap;
253
    }
24739 tejbeer 254
 
32494 amit.gupta 255
    @Override
33247 ranu 256
    public Map<Integer, Integer> getWaleltRetailerMap(Set<Integer> walletIds) throws ProfitMandiBusinessException {
32494 amit.gupta 257
        List<UserWallet> userWallets = userWalletRepository.selectAllById(walletIds);
258
        Map<Integer, Integer> walletRetailerMap = new HashMap<>();
259
        for (UserWallet userWallet : userWallets) {
260
            walletRetailerMap.put(userWallet.getId(), userWallet.getUserId());
261
        }
262
        return walletRetailerMap;
263
    }
30740 amit.gupta 264
 
32494 amit.gupta 265
    @Override
266
    public boolean isExistWalletHistory(int retailerId, int referenceId, WalletReferenceType referenceType)
267
            throws ProfitMandiBusinessException {
268
        if (underMaintainance) {
269
            throw pbse;
270
        }
271
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
272
        return userWalletHistoryRepository.isExist(userWallet.getId(), referenceType, referenceId);
273
    }
25542 amit.gupta 274
 
32494 amit.gupta 275
    @Override
276
    public UserWallet getUserWallet(int retailerId) throws ProfitMandiBusinessException {
277
        if (underMaintainance) {
278
            throw pbse;
279
        }
280
        try {
281
            return userWalletRepository.selectByRetailerId(retailerId);
282
        } catch (Exception e) {
283
            UserWallet uw = new UserWallet();
284
            uw.setAmount(0);
285
            uw.setRefundableAmount(0);
286
            uw.setUserId(retailerId);
287
            userWalletRepository.persist(uw);
288
            return uw;
289
        }
290
    }
25542 amit.gupta 291
 
32494 amit.gupta 292
    @Override
293
    public float getOpeningTill(int fofoId, LocalDateTime date) throws ProfitMandiBusinessException {
294
        UserWallet wallet = userWalletRepository.selectByRetailerId(fofoId);
295
        return userWalletHistoryRepository.getSumTillDate(wallet.getId(), date);
296
    }
24739 tejbeer 297
 
32494 amit.gupta 298
    @Override
299
    public boolean refundToWallet(int retailerId, float amountToRefund, int transactionId,
300
                                  WalletReferenceType walletReferenceType, String description) throws ProfitMandiBusinessException {
24739 tejbeer 301
 
32494 amit.gupta 302
        List<UserWalletHistory> all_entries = userWalletHistoryRepository
303
                .selectAllByreferenceIdandreferenceType(transactionId, walletReferenceType);
30449 amit.gupta 304
 
32494 amit.gupta 305
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
35828 amit 306
        int walletAmount = userWallet.getAmount();
32494 amit.gupta 307
        LOGGER.info("userWallet" + userWallet);
308
        int max_eligible_credit_amount = 0;
24739 tejbeer 309
 
32494 amit.gupta 310
        LOGGER.info("all_entries {}", all_entries);
311
        for (UserWalletHistory history : all_entries) {
312
            max_eligible_credit_amount -= history.getAmount();
313
        }
314
        if (max_eligible_credit_amount < amountToRefund) {
315
            LOGGER.info("Cant be credited back to wallet as most of it has been already credited");
316
            return false;
317
        }
22550 ashik.ali 318
 
32494 amit.gupta 319
        userWallet.setAmount(walletAmount + Math.round(amountToRefund));
23509 amit.gupta 320
 
32494 amit.gupta 321
        LOGGER.info("userWallet" + userWallet);
30449 amit.gupta 322
 
32494 amit.gupta 323
        UserWalletHistory userWalletHistory = new UserWalletHistory();
324
        userWalletHistory.setAmount(Math.round(amountToRefund));
325
        userWalletHistory.setReference(transactionId);
326
        userWalletHistory.setReferenceType(walletReferenceType);
327
        userWalletHistory.setWalletId(userWallet.getId());
328
        userWalletHistory.setTimestamp(LocalDateTime.now());
329
        userWalletHistory.setDescription(description);
330
        userWalletHistory.setBusinessTimestamp(all_entries.get(0).getBusinessTimestamp());
36513 amit 331
        userWalletHistory.setRunningBalance(userWallet.getAmount());
30449 amit.gupta 332
 
32494 amit.gupta 333
        userWalletHistoryRepository.persist(userWalletHistory);
334
        return true;
24739 tejbeer 335
 
32494 amit.gupta 336
    }
26254 amit.gupta 337
 
32494 amit.gupta 338
    @Override
339
    public int getWalletAmount(int retailerId) throws ProfitMandiBusinessException {
340
        UserWallet userWallet = userWalletRepository.selectByRetailerId(retailerId);
341
        if (userWallet == null) {
33421 amit.gupta 342
            userWallet = new UserWallet();
343
            userWallet.setUserId(retailerId);
344
            userWalletRepository.persist(userWallet);
32494 amit.gupta 345
        }
35828 amit 346
        int sum = (int) userWalletHistoryRepository.selectSumByWallet(userWallet.getId());
347
        userWallet.setAmount(sum);
348
        return sum;
32494 amit.gupta 349
    }
24739 tejbeer 350
 
32494 amit.gupta 351
    @Override
352
    public List<UserWalletHistory> getAllByReference(int fofoId, int reference, WalletReferenceType walletReferenceType)
353
            throws ProfitMandiBusinessException {
354
        UserWallet userWallet = userWalletRepository.selectByRetailerId(fofoId);
355
        if (userWallet == null) {
356
            return new ArrayList<UserWalletHistory>();
357
        }
358
        return userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(userWallet.getId(), reference,
359
                walletReferenceType);
360
    }
30449 amit.gupta 361
 
32494 amit.gupta 362
    @Override
363
    public void resetWallet() throws ProfitMandiBusinessException {
364
        List<UserWallet> userWallets = userWalletRepository.selectAll();
365
        for (UserWallet userWallet : userWallets) {
366
            userWallet.setAmount(this.getWalletAmount(userWallet.getUserId()));
24739 tejbeer 367
 
32494 amit.gupta 368
        }
369
    }
25395 tejbeer 370
 
32494 amit.gupta 371
    @Override
372
    public int getManualReference(WalletReferenceType referenceType) {
373
        ManualPaymentType paymentType = manualPaymentRequestRepository.selectByReferenceType(referenceType);
24739 tejbeer 374
 
32494 amit.gupta 375
        if (paymentType == null) {
376
            paymentType = new ManualPaymentType();
377
            paymentType.setReferenceType(referenceType);
378
            manualPaymentRequestRepository.persist(paymentType);
379
        }
380
        paymentType.setCounter(paymentType.getCounter() + 1);
381
        return paymentType.getCounter();
24739 tejbeer 382
 
32494 amit.gupta 383
    }
34261 tejus.loha 384
 
385
    @Override
386
    public ResponseEntity<?> createAddWalletRequestReport(LocalDateTime startDate, LocalDateTime endDate, AddWalletRequestStatus status) throws Exception {
387
        List<List<?>> rows = new ArrayList<>();
388
        List<String> header = Arrays.asList(
389
                "Retailer Id",
390
                "Retailer Name",
391
                "Email",
392
                "City",
393
                "State",
394
                "Transaction Reference",
395
                "Bank Name",
396
                "Reference Date",
397
                "Amount",
398
                "status",
399
                "Created On",
400
                "Updated On"
401
        );
402
 
403
        List<AddWalletRequest> addWalletRequests = addWalletRequestRepository.selectAllRetailerIdByDateAndStatus(startDate, endDate, status);
404
        Map<Integer, CustomRetailer> customRetailerMap = retailerService.getAllFofoRetailers();
405
        for (AddWalletRequest addWalletRequest : addWalletRequests) {
406
            CustomRetailer customRetailer = customRetailerMap.get(addWalletRequest.getRetailerId());
407
            rows.add(Arrays
408
                    .asList(
409
                            addWalletRequest.getRetailerId(),
410
                            customRetailer.getBusinessName(),
411
                            customRetailer.getEmail(),
412
                            customRetailer.getAddress().getCity(),
413
                            customRetailer.getAddress().getState(),
414
                            addWalletRequest.getTransaction_reference(),
415
                            addWalletRequest.getBank_name(),
416
                            addWalletRequest.getReference_date(),
417
                            addWalletRequest.getAmount(),
418
                            addWalletRequest.getStatus(),
419
                            addWalletRequest.getCreateTimestamp(),
420
                            addWalletRequest.getUpdateTimestamp()
421
                    )
422
            );
423
        }
424
        org.apache.commons.io.output.ByteArrayOutputStream baos = FileUtil.getCSVByteStream(header, rows);
425
        ResponseEntity<?> responseEntity = orderService.downloadReportInCsv(baos, rows, "Add-wallet-request-"+status+"-Reort-" + startDate.toLocalDate() + "-To-" + endDate.toLocalDate());
426
        return responseEntity;
427
    }
32494 amit.gupta 428
}
24739 tejbeer 429