| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| 3 |
import java.io.ByteArrayInputStream;
|
- |
|
| 4 |
import java.io.ByteArrayOutputStream;
|
- |
|
| 5 |
import java.io.InputStream;
|
- |
|
| 6 |
import java.text.MessageFormat;
|
- |
|
| 7 |
import java.time.LocalDate;
|
- |
|
| 8 |
import java.time.LocalDateTime;
|
- |
|
| 9 |
import java.time.ZoneId;
|
- |
|
| 10 |
import java.util.ArrayList;
|
- |
|
| 11 |
import java.util.Arrays;
|
- |
|
| 12 |
import java.util.Collections;
|
- |
|
| 13 |
import java.util.Date;
|
- |
|
| 14 |
import java.util.HashMap;
|
- |
|
| 15 |
import java.util.List;
|
- |
|
| 16 |
import java.util.Map;
|
- |
|
| 17 |
import java.util.Set;
|
- |
|
| 18 |
import java.util.stream.Collectors;
|
- |
|
| 19 |
|
- |
|
| 20 |
import javax.mail.internet.InternetAddress;
|
- |
|
| 21 |
import javax.mail.internet.MimeMessage;
|
- |
|
| 22 |
import javax.servlet.http.HttpServletRequest;
|
- |
|
| 23 |
import javax.swing.SortOrder;
|
- |
|
| 24 |
import javax.transaction.Transactional;
|
- |
|
| 25 |
|
- |
|
| 26 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 27 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 28 |
import org.apache.poi.ss.usermodel.Cell;
|
- |
|
| 29 |
import org.apache.poi.ss.usermodel.CellStyle;
|
- |
|
| 30 |
import org.apache.poi.ss.usermodel.CreationHelper;
|
- |
|
| 31 |
import org.apache.poi.ss.usermodel.Sheet;
|
- |
|
| 32 |
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
- |
|
| 33 |
import org.json.JSONObject;
|
- |
|
| 34 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 35 |
import org.springframework.core.io.InputStreamResource;
|
- |
|
| 36 |
import org.springframework.http.HttpHeaders;
|
- |
|
| 37 |
import org.springframework.http.HttpStatus;
|
- |
|
| 38 |
import org.springframework.http.ResponseEntity;
|
- |
|
| 39 |
import org.springframework.mail.javamail.JavaMailSender;
|
- |
|
| 40 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
- |
|
| 41 |
import org.springframework.stereotype.Controller;
|
- |
|
| 42 |
import org.springframework.ui.Model;
|
- |
|
| 43 |
import org.springframework.web.bind.annotation.PostMapping;
|
- |
|
| 44 |
import org.springframework.web.bind.annotation.RequestBody;
|
- |
|
| 45 |
import org.springframework.web.bind.annotation.RequestMapping;
|
- |
|
| 46 |
import org.springframework.web.bind.annotation.RequestMethod;
|
- |
|
| 47 |
import org.springframework.web.bind.annotation.RequestParam;
|
- |
|
| 48 |
import org.springframework.web.bind.annotation.RequestPart;
|
- |
|
| 49 |
import org.springframework.web.multipart.MultipartFile;
|
- |
|
| 50 |
|
- |
|
| 51 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 52 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
4 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 53 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
5 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 54 |
import com.spice.profitmandi.common.model.UnsettledPaymentModel;
|
6 |
import com.spice.profitmandi.common.model.UnsettledPaymentModel;
|
| 55 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
7 |
import com.spice.profitmandi.common.util.ExcelUtils;
|
| 56 |
import com.spice.profitmandi.common.util.FileUtil;
|
8 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 57 |
import com.spice.profitmandi.common.util.StringUtils;
|
9 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 58 |
import com.spice.profitmandi.common.util.WalletHistoryModel;
|
10 |
import com.spice.profitmandi.common.util.WalletHistoryModel;
|
| 59 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
11 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
| 60 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
12 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 61 |
import com.spice.profitmandi.dao.entity.transaction.AddWalletRequest;
|
- |
|
| 62 |
import com.spice.profitmandi.dao.entity.transaction.ManualPaymentType;
|
- |
|
| 63 |
import com.spice.profitmandi.dao.entity.transaction.UnsettledPayment;
|
- |
|
| 64 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
13 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 65 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
- |
|
| 66 |
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
|
14 |
import com.spice.profitmandi.dao.enumuration.transaction.AddWalletRequestStatus;
|
| 67 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionType;
|
15 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionType;
|
| 68 |
import com.spice.profitmandi.dao.repository.catalog.AddWalletRequestRepository;
|
16 |
import com.spice.profitmandi.dao.repository.catalog.AddWalletRequestRepository;
|
| 69 |
import com.spice.profitmandi.dao.repository.catalog.ManualPaymentRequestRepository;
|
17 |
import com.spice.profitmandi.dao.repository.catalog.ManualPaymentRequestRepository;
|
| 70 |
import com.spice.profitmandi.dao.repository.catalog.UnsettledPaymentsRepository;
|
18 |
import com.spice.profitmandi.dao.repository.catalog.UnsettledPaymentsRepository;
|
| Line 80... |
Line 28... |
| 80 |
import com.spice.profitmandi.service.user.RetailerService;
|
28 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 81 |
import com.spice.profitmandi.service.wallet.WalletService;
|
29 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 82 |
import com.spice.profitmandi.web.model.LoginDetails;
|
30 |
import com.spice.profitmandi.web.model.LoginDetails;
|
| 83 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
31 |
import com.spice.profitmandi.web.util.CookiesProcessor;
|
| 84 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
32 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 85 |
|
- |
|
| 86 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
33 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| - |
|
34 |
import org.apache.logging.log4j.LogManager;
|
| - |
|
35 |
import org.apache.logging.log4j.Logger;
|
| - |
|
36 |
import org.apache.poi.ss.usermodel.Cell;
|
| - |
|
37 |
import org.apache.poi.ss.usermodel.CellStyle;
|
| - |
|
38 |
import org.apache.poi.ss.usermodel.CreationHelper;
|
| - |
|
39 |
import org.apache.poi.ss.usermodel.Sheet;
|
| - |
|
40 |
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
| - |
|
41 |
import org.json.JSONObject;
|
| - |
|
42 |
import org.springframework.beans.factory.annotation.Autowired;
|
| - |
|
43 |
import org.springframework.core.io.InputStreamResource;
|
| - |
|
44 |
import org.springframework.http.HttpHeaders;
|
| - |
|
45 |
import org.springframework.http.HttpStatus;
|
| - |
|
46 |
import org.springframework.http.ResponseEntity;
|
| - |
|
47 |
import org.springframework.mail.javamail.JavaMailSender;
|
| - |
|
48 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
| - |
|
49 |
import org.springframework.stereotype.Controller;
|
| - |
|
50 |
import org.springframework.ui.Model;
|
| - |
|
51 |
import org.springframework.web.bind.annotation.*;
|
| - |
|
52 |
import org.springframework.web.multipart.MultipartFile;
|
| - |
|
53 |
|
| - |
|
54 |
import javax.mail.internet.InternetAddress;
|
| - |
|
55 |
import javax.mail.internet.MimeMessage;
|
| - |
|
56 |
import javax.servlet.http.HttpServletRequest;
|
| - |
|
57 |
import javax.swing.*;
|
| - |
|
58 |
import javax.transaction.Transactional;
|
| - |
|
59 |
import java.io.ByteArrayInputStream;
|
| - |
|
60 |
import java.io.ByteArrayOutputStream;
|
| - |
|
61 |
import java.io.InputStream;
|
| - |
|
62 |
import java.text.MessageFormat;
|
| - |
|
63 |
import java.time.LocalDate;
|
| - |
|
64 |
import java.time.LocalDateTime;
|
| - |
|
65 |
import java.time.ZoneId;
|
| - |
|
66 |
import java.util.*;
|
| - |
|
67 |
import java.util.stream.Collectors;
|
| 87 |
|
68 |
|
| 88 |
@Controller
|
69 |
@Controller
|
| 89 |
@Transactional(rollbackOn = Throwable.class)
|
70 |
@Transactional(rollbackOn = Throwable.class)
|
| 90 |
public class WalletController {
|
71 |
public class WalletController {
|
| 91 |
|
72 |
|
| Line 941... |
Line 922... |
| 941 |
|
922 |
|
| 942 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
923 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
| 943 |
return "wallet-history";
|
924 |
return "wallet-history";
|
| 944 |
|
925 |
|
| 945 |
}
|
926 |
}
|
| 946 |
|
- |
|
| 947 |
@RequestMapping(value = "/getPartnerName", method = RequestMethod.GET)
|
927 |
@RequestMapping(value = "/getPartnerName", method = RequestMethod.GET)
|
| 948 |
public String getPartnerName(HttpServletRequest request,
|
928 |
public String getPartnerName(HttpServletRequest request,
|
| 949 |
@RequestParam(name = "reference", defaultValue = "0") int reference,
|
929 |
@RequestParam(name = "reference", defaultValue = "0") int reference,
|
| 950 |
@RequestParam WalletReferenceType referenceType, Model model) throws Exception {
|
930 |
@RequestParam WalletReferenceType referenceType, Model model) throws Exception {
|
| 951 |
|
931 |
|