| Line 70... |
Line 70... |
| 70 |
import com.spice.profitmandi.common.model.PdfModel;
|
70 |
import com.spice.profitmandi.common.model.PdfModel;
|
| 71 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
71 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 72 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
72 |
import com.spice.profitmandi.common.model.RechargeCredential;
|
| 73 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
73 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
| 74 |
import com.spice.profitmandi.common.services.ReporticoService;
|
74 |
import com.spice.profitmandi.common.services.ReporticoService;
|
| - |
|
75 |
import com.spice.profitmandi.common.services.mandii.AccountStatusResponseOut;
|
| - |
|
76 |
import com.spice.profitmandi.common.services.mandii.EligibilityStatusEnum;
|
| - |
|
77 |
import com.spice.profitmandi.common.services.mandii.MandiiService;
|
| 75 |
import com.spice.profitmandi.common.util.FileUtil;
|
78 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 76 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
79 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 77 |
import com.spice.profitmandi.common.util.PdfUtils;
|
80 |
import com.spice.profitmandi.common.util.PdfUtils;
|
| 78 |
import com.spice.profitmandi.common.util.Utils;
|
81 |
import com.spice.profitmandi.common.util.Utils;
|
| 79 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
82 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
| 80 |
import com.spice.profitmandi.common.web.client.RestClient;
|
83 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| - |
|
84 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 81 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
85 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
| 82 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
86 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 83 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
|
87 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
|
| 84 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
88 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 85 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
89 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| 86 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
90 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 87 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
91 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
| - |
|
92 |
import com.spice.profitmandi.dao.entity.dtr.CreditAccount;
|
| - |
|
93 |
import com.spice.profitmandi.dao.entity.dtr.CreditStatus;
|
| 88 |
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
|
94 |
import com.spice.profitmandi.dao.entity.dtr.DailyRecharge;
|
| 89 |
import com.spice.profitmandi.dao.entity.dtr.EmployeeAttendance;
|
95 |
import com.spice.profitmandi.dao.entity.dtr.EmployeeAttendance;
|
| 90 |
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
|
96 |
import com.spice.profitmandi.dao.entity.dtr.InsurancePolicy;
|
| 91 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
97 |
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
|
| 92 |
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
|
98 |
import com.spice.profitmandi.dao.entity.dtr.PushNotifications;
|
| Line 126... |
Line 132... |
| 126 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
132 |
import com.spice.profitmandi.dao.entity.user.Lead;
|
| 127 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
133 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
| 128 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
134 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 129 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
135 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 130 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
136 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| - |
|
137 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| 131 |
import com.spice.profitmandi.dao.enumuration.fofo.PartnerStatusType;
|
138 |
import com.spice.profitmandi.dao.enumuration.fofo.PartnerStatusType;
|
| 132 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
139 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 133 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
140 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
| 134 |
import com.spice.profitmandi.dao.model.FinanceServicesModel;
|
141 |
import com.spice.profitmandi.dao.model.FinanceServicesModel;
|
| 135 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
142 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| Line 143... |
Line 150... |
| 143 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
150 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 144 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
151 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
| 145 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
152 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| 146 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
153 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
| 147 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
154 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
| - |
|
155 |
import com.spice.profitmandi.dao.repository.dtr.CreditAccountRepository;
|
| 148 |
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
|
156 |
import com.spice.profitmandi.dao.repository.dtr.DailyRechargeRepository;
|
| 149 |
import com.spice.profitmandi.dao.repository.dtr.EmployeeAttendanceRepository;
|
157 |
import com.spice.profitmandi.dao.repository.dtr.EmployeeAttendanceRepository;
|
| 150 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
158 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 151 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeActivityRepository;
|
159 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeActivityRepository;
|
| 152 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeVisitRepository;
|
160 |
import com.spice.profitmandi.dao.repository.dtr.FranchiseeVisitRepository;
|
| Line 532... |
Line 540... |
| 532 |
private CustomerRepository customerRepository;
|
540 |
private CustomerRepository customerRepository;
|
| 533 |
|
541 |
|
| 534 |
@Autowired
|
542 |
@Autowired
|
| 535 |
private RestClient restClient;
|
543 |
private RestClient restClient;
|
| 536 |
|
544 |
|
| - |
|
545 |
@Autowired
|
| - |
|
546 |
private MandiiService mandiiService;
|
| - |
|
547 |
|
| - |
|
548 |
@Autowired
|
| - |
|
549 |
CreditAccountRepository creditAccountRepository;
|
| 537 |
private static final Logger LOGGER = LogManager.getLogger(ScheduledTasks.class);
|
550 |
private static final Logger LOGGER = LogManager.getLogger(ScheduledTasks.class);
|
| 538 |
|
551 |
|
| 539 |
private String FCM_URL = "https://fcm.googleapis.com/fcm/send";
|
552 |
private String FCM_URL = "https://fcm.googleapis.com/fcm/send";
|
| 540 |
private String FCM_API_KEY = "AAAASAjNcn4:APA91bG6fWRIgYJI0L9gCjP5ynaXz2hJHYKtD9dfH7Depdv31Nd9APJwhx-OPkAJ1WSz4BGNYG8lHThLFSjDGFxIwUZv241YcAJEGDLgt86mxq9FXJe-yBRu-S0_ZwHqmX-QaVKl5F_A";
|
553 |
private String FCM_API_KEY = "AAAASAjNcn4:APA91bG6fWRIgYJI0L9gCjP5ynaXz2hJHYKtD9dfH7Depdv31Nd9APJwhx-OPkAJ1WSz4BGNYG8lHThLFSjDGFxIwUZv241YcAJEGDLgt86mxq9FXJe-yBRu-S0_ZwHqmX-QaVKl5F_A";
|
| 541 |
|
554 |
|
| Line 3227... |
Line 3240... |
| 3227 |
}
|
3240 |
}
|
| 3228 |
|
3241 |
|
| 3229 |
}
|
3242 |
}
|
| 3230 |
}
|
3243 |
}
|
| 3231 |
|
3244 |
|
| - |
|
3245 |
public void partnerWiseCreditAccount() throws Exception {
|
| - |
|
3246 |
|
| - |
|
3247 |
List<FofoStore> fofoStores = fofoStoreRepository.selectActiveStores();
|
| - |
|
3248 |
|
| - |
|
3249 |
for (FofoStore fs : fofoStores) {
|
| - |
|
3250 |
|
| - |
|
3251 |
if (fs.getPan() != null) {
|
| - |
|
3252 |
AccountStatusResponseOut accountStatusResponseOut = mandiiService.getStatus(fs.getPan());
|
| - |
|
3253 |
CreditAccount creditAccount = creditAccountRepository.selectByFofoIdAndGateway(fs.getId(),
|
| - |
|
3254 |
Gateway.MANDII);
|
| - |
|
3255 |
|
| - |
|
3256 |
if (creditAccount == null) {
|
| - |
|
3257 |
|
| - |
|
3258 |
creditAccount = new CreditAccount();
|
| - |
|
3259 |
|
| - |
|
3260 |
creditAccount.setFofoId(fs.getId());
|
| - |
|
3261 |
creditAccount.setGateway(Gateway.MANDII);
|
| - |
|
3262 |
|
| - |
|
3263 |
}
|
| - |
|
3264 |
creditAccount.setSanctionedAmount(accountStatusResponseOut.getSanctionLimit().floatValue());
|
| - |
|
3265 |
creditAccount.setInterestRate(accountStatusResponseOut.getRateOfInterest());
|
| - |
|
3266 |
creditAccount.setAvailableAmount(accountStatusResponseOut.getBalanceAmount().floatValue());
|
| - |
|
3267 |
creditAccount.setUpdatedOn(LocalDateTime.now());
|
| - |
|
3268 |
creditAccount.setDescription(accountStatusResponseOut.getCurrentStage().toString());
|
| - |
|
3269 |
if (accountStatusResponseOut.getStatus().equals(EligibilityStatusEnum.SANCTION_AVAILABLE)) {
|
| - |
|
3270 |
creditAccount.setCreditStatus(CreditStatus.SANCTIONED);
|
| - |
|
3271 |
} else if (accountStatusResponseOut.getStatus().equals(EligibilityStatusEnum.IN_ELIGIBLE)) {
|
| - |
|
3272 |
creditAccount.setCreditStatus(CreditStatus.INELIGIBLE);
|
| - |
|
3273 |
} else {
|
| - |
|
3274 |
|
| - |
|
3275 |
creditAccount.setCreditStatus(CreditStatus.TO_BE_EVALUATED);
|
| - |
|
3276 |
}
|
| - |
|
3277 |
creditAccountRepository.persist(creditAccount);
|
| - |
|
3278 |
}
|
| - |
|
3279 |
}
|
| - |
|
3280 |
}
|
| - |
|
3281 |
|
| 3232 |
}
|
3282 |
}
|
| - |
|
3283 |
|
| 3233 |
//2284
|
3284 |
//2284
|
| 3234 |
|
3285 |
|