Rev 28755 | Rev 28801 | 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 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 int serviceId;private String brand;private String name;private String code;private String fofoCode;private LocalDateTime createTimestamp;private LocalDateTime deploymentDate;private LocalDateTime payDate;private static final Logger LOGGER = LogManager.getLogger(FinanceServicesModel.class);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;}}else if (this.getName().equals("SAMSUNG SURE")) {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;}}}else if (this.getName().equals("BAJAJ FINSERV")) {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;}}}else if (this.getName().equals("HOME CREDIT")) {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;}}}else if (this.getName().equals("HDB")) {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;}}}else if (this.getName().equals("CAPITAL FIRST")) {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;}@Overridepublic String toString() {return "FinanceServicesModel [fofoId=" + fofoId + ", partnerStatusType=" + partnerStatusType+ ", applicableType=" + applicableType + ", active=" + active + ", brandServiceId=" + brandServiceId+ ", serviceId=" + serviceId + ", brand=" + brand + ", name=" + name + ", code=" + code + ", fofoCode="+ fofoCode + ", createTimestamp=" + createTimestamp + ", deploymentDate=" + deploymentDate+ ", payDate=" + payDate + "]";}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 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;}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + (active ? 1231 : 1237);result = prime * result + ((applicableType == null) ? 0 : applicableType.hashCode());result = prime * result + ((brand == null) ? 0 : brand.hashCode());result = prime * result + brandServiceId;result = prime * result + ((code == null) ? 0 : code.hashCode());result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());result = prime * result + ((fofoCode == null) ? 0 : fofoCode.hashCode());result = prime * result + fofoId;result = prime * result + ((name == null) ? 0 : name.hashCode());result = prime * result + ((partnerStatusType == null) ? 0 : partnerStatusType.hashCode());result = prime * result + serviceId;return result;}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;FinanceServicesModel other = (FinanceServicesModel) obj;if (active != other.active)return false;if (applicableType != other.applicableType)return false;if (brand == null) {if (other.brand != null)return false;} else if (!brand.equals(other.brand))return false;if (brandServiceId != other.brandServiceId)return false;if (code == null) {if (other.code != null)return false;} else if (!code.equals(other.code))return false;if (createTimestamp == null) {if (other.createTimestamp != null)return false;} else if (!createTimestamp.equals(other.createTimestamp))return false;if (fofoCode == null) {if (other.fofoCode != null)return false;} else if (!fofoCode.equals(other.fofoCode))return false;if (fofoId != other.fofoId)return false;if (name == null) {if (other.name != null)return false;} else if (!name.equals(other.name))return false;if (partnerStatusType != other.partnerStatusType)return false;if (serviceId != other.serviceId)return false;return true;}public FinanceServicesModel(int fofoId, PartnerStatusType partnerStatusType, ApplicableServiceType applicableType,boolean active, int brandServiceId, int serviceId, String brand, String name, String code, String fofoCode,LocalDateTime createTimestamp) {super();this.fofoId = fofoId;this.partnerStatusType = partnerStatusType;this.applicableType = applicableType;this.active = active;this.brandServiceId = brandServiceId;this.serviceId = serviceId;this.brand = brand;this.name = name;this.code = code;this.fofoCode = fofoCode;this.createTimestamp = createTimestamp;}}