Rev 29767 | 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 LocalDateTime psPendingCreateTimestamp;private String psNaComment;private String psGenComment;private String partnerNotInterestedServiceComment;private String fofoCode;private LocalDateTime fofoactiveTimeStamp;private LocalDateTime createTimestamp;private String documentsCompleted;private LocalDate allFollowupDate;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 {if(this.getServiceCodeCreateTimestamp() != null ) {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() != null && this.getName() != "") {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){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();LocalDateTime endDate = minDate.plusDays(15);LOGGER.info("endDate" + endDate);if (currDate.isBefore(endDate)) {return true;}else {return false;}}else if (this.getPayDate() == null && this.getDeploymentDate() == null) {return true;}else if (this.getPayDate() == null) {minDate = this.getDeploymentDate();LocalDateTime endDate = minDate.plusDays(15);if (currDate.isBefore(endDate)) {return true;}else {return false;}} else {minDate = this.getPayDate();LocalDateTime endDate = minDate.plusDays(15);if (currDate.isBefore(endDate)) {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;}public String getPsGenComment() {return psGenComment;}public void setPsGenComment(String psGenComment) {this.psGenComment = psGenComment;}public String getDocumentsCompleted() {return documentsCompleted;}public void setDocumentsCompleted(String documentsCompleted) {this.documentsCompleted = documentsCompleted;}public LocalDateTime getPsPendingCreateTimestamp() {return psPendingCreateTimestamp;}public void setPsPendingCreateTimestamp(LocalDateTime psPendingCreateTimestamp) {this.psPendingCreateTimestamp = psPendingCreateTimestamp;}public LocalDate getAllFollowupDate() {return allFollowupDate;}public void setAllFollowupDate(LocalDate allFollowupDate) {this.allFollowupDate = allFollowupDate;}public String getPartnerNotInterestedServiceComment() {return partnerNotInterestedServiceComment;}public void setPartnerNotInterestedServiceComment(String partnerNotInterestedServiceComment) {this.partnerNotInterestedServiceComment = partnerNotInterestedServiceComment;}@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 + ", psPendingCreateTimestamp=" + psPendingCreateTimestamp+ ", psNaComment=" + psNaComment + ", psGenComment=" + psGenComment+ ", partnerNotInterestedServiceComment=" + partnerNotInterestedServiceComment + ", fofoCode="+ fofoCode + ", fofoactiveTimeStamp=" + fofoactiveTimeStamp + ", createTimestamp=" + createTimestamp+ ", documentsCompleted=" + documentsCompleted + ", allFollowupDate=" + allFollowupDate + "]";}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, LocalDateTime psPendingCreateTimestamp, String psNaComment,String psGenComment, String partnerNotInterestedServiceComment, String fofoCode,LocalDateTime fofoactiveTimeStamp, LocalDateTime createTimestamp, String documentsCompleted,LocalDate allFollowupDate) {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.psPendingCreateTimestamp = psPendingCreateTimestamp;this.psNaComment = psNaComment;this.psGenComment = psGenComment;this.partnerNotInterestedServiceComment = partnerNotInterestedServiceComment;this.fofoCode = fofoCode;this.fofoactiveTimeStamp = fofoactiveTimeStamp;this.createTimestamp = createTimestamp;this.documentsCompleted = documentsCompleted;this.allFollowupDate = allFollowupDate;}}