| Line 82... |
Line 82... |
| 82 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
82 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 83 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
83 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 84 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
84 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
| 85 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
85 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 86 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
86 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
| - |
|
87 |
import com.spice.profitmandi.dao.entity.transaction.HdfcPayment;
|
| 87 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
88 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
| 88 |
import com.spice.profitmandi.dao.entity.transaction.PriceDropIMEI;
|
89 |
import com.spice.profitmandi.dao.entity.transaction.PriceDropIMEI;
|
| 89 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
90 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
| 90 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
91 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
| 91 |
import com.spice.profitmandi.dao.entity.user.Address;
|
92 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| Line 94... |
Line 95... |
| 94 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
95 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
| 95 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
96 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 96 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
97 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 97 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
98 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 98 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
99 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
| - |
|
100 |
import com.spice.profitmandi.dao.model.AddPaymentRequest;
|
| - |
|
101 |
import com.spice.profitmandi.dao.model.AddPaymentResponse;
|
| 99 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
102 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 100 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
103 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| 101 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
104 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 102 |
import com.spice.profitmandi.dao.repository.catalog.DeviceRepository;
|
105 |
import com.spice.profitmandi.dao.repository.catalog.DeviceRepository;
|
| 103 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
106 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
| Line 130... |
Line 133... |
| 130 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
133 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| 131 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
134 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 132 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
135 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
| 133 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
136 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 134 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
137 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| - |
|
138 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
| 135 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
139 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 136 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
|
140 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
|
| 137 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
141 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
| 138 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
|
142 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
|
| 139 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
143 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
| Line 152... |
Line 156... |
| 152 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
156 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 153 |
import com.spice.profitmandi.service.user.RetailerService;
|
157 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 154 |
import com.spice.profitmandi.service.wallet.WalletService;
|
158 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 155 |
|
159 |
|
| 156 |
import in.shop2020.model.v1.order.OrderStatus;
|
160 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 157 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
161 |
import in.shop2020.model.v1.order.WalletReferenceType;;
|
| 158 |
import javassist.tools.framedump;;
|
- |
|
| 159 |
|
162 |
|
| 160 |
@Component
|
163 |
@Component
|
| 161 |
@Transactional(rollbackFor = Throwable.class)
|
164 |
@Transactional(rollbackFor = Throwable.class)
|
| 162 |
public class ScheduledTasks {
|
165 |
public class ScheduledTasks {
|
| 163 |
|
166 |
|
| Line 184... |
Line 187... |
| 184 |
|
187 |
|
| 185 |
@Autowired
|
188 |
@Autowired
|
| 186 |
private FranchiseeActivityRepository franchiseeActivityRepository;
|
189 |
private FranchiseeActivityRepository franchiseeActivityRepository;
|
| 187 |
|
190 |
|
| 188 |
@Autowired
|
191 |
@Autowired
|
| - |
|
192 |
private HdfcPaymentRepository hdfcPaymentRepository;
|
| - |
|
193 |
|
| - |
|
194 |
@Autowired
|
| 189 |
private CsService csService;
|
195 |
private CsService csService;
|
| 190 |
|
196 |
|
| 191 |
@Autowired
|
197 |
@Autowired
|
| 192 |
private InsurancePolicyRepository insurancePolicyRepository;
|
198 |
private InsurancePolicyRepository insurancePolicyRepository;
|
| 193 |
|
199 |
|
| Line 2031... |
Line 2037... |
| 2031 |
sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(visit.getAuthId())));
|
2037 |
sendNotificationModel.setUserIds(Arrays.asList(authUserKeyMap.get(visit.getAuthId())));
|
| 2032 |
notificationService.sendNotification(sendNotificationModel);
|
2038 |
notificationService.sendNotification(sendNotificationModel);
|
| 2033 |
}
|
2039 |
}
|
| 2034 |
}
|
2040 |
}
|
| 2035 |
|
2041 |
|
| - |
|
2042 |
public AddPaymentResponse addPayment(AddPaymentRequest addPaymentRequest) throws Exception {
|
| - |
|
2043 |
HdfcPayment hdfcPayment = hdfcPaymentRepository.selectByTransactionId(addPaymentRequest.getTransactionId());
|
| - |
|
2044 |
AddPaymentResponse response = new AddPaymentResponse();
|
| - |
|
2045 |
if (hdfcPayment == null) {
|
| - |
|
2046 |
hdfcPayment = new HdfcPayment();
|
| - |
|
2047 |
hdfcPayment.setAmount(addPaymentRequest.getAmount());
|
| - |
|
2048 |
hdfcPayment.setCreateTimestamp(LocalDateTime.now());
|
| - |
|
2049 |
hdfcPayment.setCreditTimestamp(addPaymentRequest.getCreditDateTime());
|
| - |
|
2050 |
hdfcPayment.setFromAccountNumber(addPaymentRequest.getFromAccountNumber());
|
| - |
|
2051 |
hdfcPayment.setFromBankName(addPaymentRequest.getFromBankName());
|
| - |
|
2052 |
hdfcPayment.setMmid(addPaymentRequest.getMmid());
|
| - |
|
2053 |
hdfcPayment.setRemitterName(addPaymentRequest.getRemitterName());
|
| - |
|
2054 |
hdfcPayment.setTransactionId(addPaymentRequest.getTransactionId());
|
| - |
|
2055 |
hdfcPayment.setTransferMode(addPaymentRequest.getTransferMode());
|
| - |
|
2056 |
hdfcPayment.setUtr(addPaymentRequest.getUtr());
|
| - |
|
2057 |
hdfcPayment.setVirtualAccount(hdfcPayment.getVirtualAccount());
|
| - |
|
2058 |
hdfcPaymentRepository.persist(hdfcPayment);
|
| - |
|
2059 |
String virtualAccount = hdfcPayment.getVirtualAccount();
|
| - |
|
2060 |
String retailerIdString = virtualAccount.substring(6);
|
| - |
|
2061 |
int retailerId = Integer.parseInt(retailerIdString);
|
| - |
|
2062 |
String description = String.format("Paid through %s, Utr# %s", hdfcPayment.getTransferMode(),
|
| - |
|
2063 |
hdfcPayment.getUtr());
|
| - |
|
2064 |
walletService.addAmountToWallet(retailerId, hdfcPayment.getId(), WalletReferenceType.ADVANCE_AMOUNT,
|
| - |
|
2065 |
description, (float) hdfcPayment.getAmount());
|
| - |
|
2066 |
response.setCode("100");
|
| - |
|
2067 |
response.setStatus("Success");
|
| - |
|
2068 |
} else {
|
| - |
|
2069 |
response.setCode("200");
|
| - |
|
2070 |
response.setStatus("Duplicate");
|
| - |
|
2071 |
}
|
| - |
|
2072 |
response.setTransactionId("");
|
| - |
|
2073 |
|
| - |
|
2074 |
return response;
|
| - |
|
2075 |
}
|
| - |
|
2076 |
|
| 2036 |
|
2077 |
|
| 2037 |
|
2078 |
|
| 2038 |
}
|
2079 |
}
|
| 2039 |
|
2080 |
|