Rev 28977 | Rev 29055 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.model;import java.time.LocalDate;import java.time.LocalDateTime;import java.util.Arrays;import java.util.List;import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;import com.spice.profitmandi.dao.enumuration.fofo.ApplicableServiceType;import com.spice.profitmandi.dao.enumuration.fofo.PartnerStatusType;public class FinanceServicesModel {private int fofoId;private PartnerStatusType partnerStatusType;private ApplicableServiceType applicableType;private boolean active;private int brandServiceId;private String pbsNaComment;private String pbsPartnerStatusComment;private int serviceId;private String brand;private String name;private String code;private ApplicableServiceType serviceApplicableType;private LocalDateTime serviceCodeCreateTimestamp;private String psNaComment;private String fofoCode;private LocalDateTime fofoactiveTimeStamp;private LocalDateTime createTimestamp;private LocalDateTime deploymentDate;private LocalDateTime payDate;private static final Logger LOGGER = LogManager.getLogger(FinanceServicesModel.class);static final List<String> paperFinanceServices = Arrays.asList("SAMSUNG SURE", "BAJAJ FINSERV", "HOME CREDIT","HDB", "CAPITAL FIRST");public boolean getServiceStatusByCodeCreatedTimilines() throws NullPointerException {LocalDateTime timelineDate = this.getServiceCodeCreateTimestamp().plusDays(7);LocalDateTime currDate = LocalDate.now().atStartOfDay();if (currDate.isBefore(timelineDate)) {LOGGER.info("timeLinesDate");return true;}return false;}public boolean getServiceStatusByCodeTimeStamp() throws NullPointerException {LOGGER.info("thisName" + this.getName());LOGGER.info("fofoThis" + this.getFofoId());if (this.getName().equals("PAYTM") && this.getCreateTimestamp() != null) {LocalDateTime paytmTime = this.getCreateTimestamp().plusDays(5);LocalDateTime currDate = LocalDate.now().atStartOfDay();if (currDate.isBefore(paytmTime)) {LOGGER.info("PAYTMTrue");return true;}return false;}else if (this.getName().equals("PINELABS") && this.getCreateTimestamp() != null){LOGGER.info("PINELABS");LocalDateTime pinlabsTime = this.getCreateTimestamp().plusDays(10);LocalDateTime currDate = LocalDate.now().atStartOfDay();if (currDate.isBefore(pinlabsTime)) {LOGGER.info("PINELABTrue");return true;}return false;}else if (this.getName().equals("ZEST MONEY") && this.getCreateTimestamp() != null){LocalDateTime zestMoneyTime = this.getCreateTimestamp().plusDays(10);LocalDateTime currDate = LocalDate.now().atStartOfDay();if (currDate.isBefore(zestMoneyTime)) {LOGGER.info("MONEYTrue");return true;}else {return false;}}for (String paperFinanceServices : paperFinanceServices) {if (this.getName().equals(paperFinanceServices)) {LocalDateTime minDate = null;LocalDateTime currDate = LocalDate.now().atStartOfDay();if (this.getDeploymentDate() != null && this.getPayDate() != null) {minDate = this.getDeploymentDate().isBefore(this.getPayDate()) ? this.getDeploymentDate(): this.getPayDate();if (currDate.isBefore(minDate)) {LOGGER.info("MONEYTrue");return true;}else {return false;}}else if (this.getPayDate() == null && this.getPayDate() == null) {return false;}else if (this.getPayDate() == null) {minDate = this.getDeploymentDate();if (currDate.isBefore(minDate)) {LOGGER.info("MONEYTrue");return true;}else {return false;}} else {minDate = this.getPayDate();if (currDate.isBefore(minDate)) {LOGGER.info("MONEYTrue");return true;}else {return false;}}}}return true;}public int getFofoId() {return fofoId;}public void setFofoId(int fofoId) {this.fofoId = fofoId;}public PartnerStatusType getPartnerStatusType() {return partnerStatusType;}public void setPartnerStatusType(PartnerStatusType partnerStatusType) {this.partnerStatusType = partnerStatusType;}public ApplicableServiceType getApplicableType() {return applicableType;}public void setApplicableType(ApplicableServiceType applicableType) {this.applicableType = applicableType;}public boolean isActive() {return active;}public void setActive(boolean active) {this.active = active;}public int getBrandServiceId() {return brandServiceId;}public void setBrandServiceId(int brandServiceId) {this.brandServiceId = brandServiceId;}public int getServiceId() {return serviceId;}public void setServiceId(int serviceId) {this.serviceId = serviceId;}public String getBrand() {return brand;}public void setBrand(String brand) {this.brand = brand;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getCode() {return code;}public void setCode(String code) {this.code = code;}public ApplicableServiceType getServiceApplicableType() {return serviceApplicableType;}public void setServiceApplicableType(ApplicableServiceType serviceApplicableType) {this.serviceApplicableType = serviceApplicableType;}public String getFofoCode() {return fofoCode;}public void setFofoCode(String fofoCode) {this.fofoCode = fofoCode;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public LocalDateTime getDeploymentDate() {return deploymentDate;}public void setDeploymentDate(LocalDateTime deploymentDate) {this.deploymentDate = deploymentDate;}public LocalDateTime getPayDate() {return payDate;}public void setPayDate(LocalDateTime payDate) {this.payDate = payDate;}public static Logger getLogger() {return LOGGER;}public String getPbsNaComment() {return pbsNaComment;}public void setPbsNaComment(String pbsNaComment) {this.pbsNaComment = pbsNaComment;}public String getPbsPartnerStatusComment() {return pbsPartnerStatusComment;}public void setPbsPartnerStatusComment(String pbsPartnerStatusComment) {this.pbsPartnerStatusComment = pbsPartnerStatusComment;}public String getPsNaComment() {return psNaComment;}public void setPsNaComment(String psNaComment) {this.psNaComment = psNaComment;}public LocalDateTime getServiceCodeCreateTimestamp() {return serviceCodeCreateTimestamp;}public void setServiceCodeCreateTimestamp(LocalDateTime serviceCodeCreateTimestamp) {this.serviceCodeCreateTimestamp = serviceCodeCreateTimestamp;}public LocalDateTime getFofoactiveTimeStamp() {return fofoactiveTimeStamp;}public void setFofoactiveTimeStamp(LocalDateTime fofoactiveTimeStamp) {this.fofoactiveTimeStamp = fofoactiveTimeStamp;}@Overridepublic String toString() {return "FinanceServicesModel [fofoId=" + fofoId + ", partnerStatusType=" + partnerStatusType+ ", applicableType=" + applicableType + ", active=" + active + ", brandServiceId=" + brandServiceId+ ", pbsNaComment=" + pbsNaComment + ", pbsPartnerStatusComment=" + pbsPartnerStatusComment+ ", serviceId=" + serviceId + ", brand=" + brand + ", name=" + name + ", code=" + code+ ", serviceApplicableType=" + serviceApplicableType + ", serviceCodeCreateTimestamp="+ serviceCodeCreateTimestamp + ", psNaComment=" + psNaComment + ", fofoCode=" + fofoCode+ ", fofoactiveTimeStamp=" + fofoactiveTimeStamp + ", createTimestamp=" + createTimestamp+ ", deploymentDate=" + deploymentDate + ", payDate=" + payDate + "]";}public FinanceServicesModel(int fofoId, PartnerStatusType partnerStatusType, ApplicableServiceType applicableType,boolean active, int brandServiceId, String pbsNaComment, String pbsPartnerStatusComment, int serviceId,String brand, String name, String code, ApplicableServiceType serviceApplicableType,LocalDateTime serviceCodeCreateTimestamp, String psNaComment, String fofoCode,LocalDateTime fofoactiveTimeStamp, LocalDateTime createTimestamp) {super();this.fofoId = fofoId;this.partnerStatusType = partnerStatusType;this.applicableType = applicableType;this.active = active;this.brandServiceId = brandServiceId;this.pbsNaComment = pbsNaComment;this.pbsPartnerStatusComment = pbsPartnerStatusComment;this.serviceId = serviceId;this.brand = brand;this.name = name;this.code = code;this.serviceApplicableType = serviceApplicableType;this.serviceCodeCreateTimestamp = serviceCodeCreateTimestamp;this.psNaComment = psNaComment;this.fofoCode = fofoCode;this.fofoactiveTimeStamp = fofoactiveTimeStamp;this.createTimestamp = createTimestamp;}}