Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class MBeneficiaryAccount {
@Column(name = "CreatedBy", length = 50, updatable = false)
private String createdBy;

@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
private Timestamp createdDate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class MBeneficiaryImage {
private String processed;
@Column(name = "CreatedBy", updatable = false)
private String createdBy;
@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
private Timestamp createdDate;
@Column(name = "Reserved")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MBeneficiaryaddress implements Serializable {
@Column(nullable = false, length = 50)
private String createdBy;

@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
private Timestamp createdDate;

@Column(length = 50)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class MBeneficiaryconsent implements Serializable {
@Column(nullable = false, length = 50)
private String createdBy;

@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
private Timestamp createdDate;

private Boolean deleted = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class MBeneficiarycontact implements Serializable {
@Column(nullable = false, length = 50, updatable = false)
private String createdBy;

@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
private Timestamp createdDate;

private Boolean deleted = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class MBeneficiarydetail implements Serializable {
@Column(nullable = false, length = 50, updatable = false)
private String createdBy;

@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
private Timestamp createdDate;

private Boolean deleted = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class MBeneficiarymapping implements Serializable {
@Column(nullable = false, length = 50)
private String createdBy;

@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
private Timestamp createdDate;

@Column(nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class MBeneficiaryregidmapping implements Serializable {
@Column(length = 30)
private String createdBy;

@Column(name = "CreatedDate", insertable = false, updatable = false)
@Column(name = "CreatedDate")
private Timestamp createdDate;

private Boolean deleted = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class IdentityDTO {
private Integer stateId;
private String stateName;
private Integer providerServiceMapId;
private Timestamp createdDate;

private Integer areaId;
private Integer beneficiaryId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public interface IdentityMapper {
IdentityMapper INSTANCE = Mappers.getMapper(IdentityMapper.class);

@Mappings({ @Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),
// new mapping added for data sync(van ID & parking place ID)
// 17-09-2018
@Mapping(source = "dto.vanID", target = "vanID"),
Expand Down Expand Up @@ -112,7 +112,8 @@ public interface IdentityMapper {
@Mapping(source = "dto.permanentAddress.addressValue", target = "permAddressValue"),
@Mapping(source = "dto.permanentAddress.pinCode", target = "permPinCode"),
@Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
//@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),

/*
* New columns added for MMU integration 09-04-2018
Expand Down Expand Up @@ -168,7 +169,7 @@ public interface IdentityMapper {
@Mapping(source = "defaultNo", target = "sharePersonalDetailsWithNGO"),
@Mapping(source = "defaultYes", target = "sharePersonalDetailsWithSpouse"),
@Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),
// new mapping added for data sync(van ID & parking place ID)
// 17-09-2018
@Mapping(source = "dto.vanID", target = "vanID"),
Expand Down Expand Up @@ -196,7 +197,7 @@ public interface IdentityMapper {
@Mapping(source = "dto.contact.phoneTyp5", target = "phoneTyp5"),
@Mapping(source = "dto.preferredEmailId", target = "emailId"),
@Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),
// new mapping added for data sync(van ID & parking place ID)
// 17-09-2018
@Mapping(source = "dto.vanID", target = "vanID"),
Expand Down Expand Up @@ -239,7 +240,7 @@ public interface IdentityMapper {
@Mapping(source = "dto.status", target = "status"), @Mapping(source = "dto.title", target = "title"),
@Mapping(source = "dto.titleId", target = "titleId"), @Mapping(source = "dto.zoneId", target = "zoneId"),
@Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),
@Mapping(target = "isHIVPositive", expression = "java(MBeneficiarydetail.setIsHIVPositive(dto.getIsHIVPositive()))"),
// Start MMU specific code
@Mapping(target = "ageAtMarriage", expression = "java(MBeneficiarydetail.getAgeAtMarriageCalc(dto.getDob(), dto.getMarriageDate(), "
Expand Down Expand Up @@ -293,7 +294,7 @@ MBeneficiaryfamilymapping identityDTOToMBeneficiaryfamilymapping(BenFamilyDTO be
@Mapping(source = "dto.agentName", target = "registeredByName"),
@Mapping(source = "dto.eventTypeDate", target = "registeredDate"),
@Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),
@Mapping(source = "dto.vanID", target = "vanID"),
@Mapping(source = "dto.parkingPlaceId", target = "parkingPlaceID") })
MBeneficiaryservicemapping identityDTOToMBeneficiaryservicemapping(IdentityDTO dto);
Expand Down Expand Up @@ -583,7 +584,7 @@ List<BenFamilyDTO> mapToMBeneficiaryfamilymappingWithBenFamilyDTOList(
@Mapping(source = "dto.ifscCode", target = "ifscCode"),
@Mapping(source = "dto.accountNo", target = "accountNo"),
@Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),
@Mapping(source = "dto.vanID", target = "vanID"),
@Mapping(source = "dto.parkingPlaceId", target = "parkingPlaceID"),
// End
Expand All @@ -595,7 +596,7 @@ List<BenFamilyDTO> mapToMBeneficiaryfamilymappingWithBenFamilyDTOList(

@Mappings({ @Mapping(source = "dto.benImage", target = "benImage"),
@Mapping(source = "dto.agentName", target = "createdBy"),
@Mapping(source = "dto.eventTypeDate", target = "createdDate"),
@Mapping(source = "dto.createdDate", target = "createdDate"),
// new mapping added for data sync(van ID & parking place ID)
// 17-09-2018
@Mapping(source = "dto.vanID", target = "vanID"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
Expand Down Expand Up @@ -937,6 +940,12 @@ public BeneficiaryCreateResp createIdentity(IdentityDTO identity) throws IEMRExc
regMap = queue.removeFirst();
}
regMap.setReserved(true);
if (regMap.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
regMap.setCreatedDate(ts);
}

regIdRepo.save(regMap);

Expand Down Expand Up @@ -967,6 +976,12 @@ public BeneficiaryCreateResp createIdentity(IdentityDTO identity) throws IEMRExc
logger.debug("identity.getPermanentAddress = " + identity.getPermanentAddress());
mAddr.setEmergencyAddress(identity.getPermanentAddress());
}
if (mAddr.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
mAddr.setCreatedDate(ts);
}

mAddr = addressRepo.save(mAddr);
logger.info("IdentityService.createIdentity - Address saved - id = " + mAddr.getBenAddressID());
Expand All @@ -976,6 +991,12 @@ public BeneficiaryCreateResp createIdentity(IdentityDTO identity) throws IEMRExc

MBeneficiaryconsent mConsnt = mapper.identityDTOToDefaultMBeneficiaryconsent(identity, true, false);
logger.info("IdentityService.createIdentity - saving Consent");
if (mConsnt.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
mConsnt.setCreatedDate(ts);
}
mConsnt = consentRepo.save(mConsnt);
logger.info("IdentityService.createIdentity - Consent saved - id = " + mConsnt.getBenConsentID());

Expand All @@ -984,6 +1005,12 @@ public BeneficiaryCreateResp createIdentity(IdentityDTO identity) throws IEMRExc

logger.info("IdentityService.createIdentity - saving Contacts");
MBeneficiarycontact mContc = mapper.identityDTOToMBeneficiarycontact(identity);
if (mContc.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
mContc.setCreatedDate(ts);
}
mContc = contactRepo.save(mContc);
logger.info("IdentityService.createIdentity - Contacts saved - id = " + mContc.getBenContactsID());

Expand All @@ -992,18 +1019,36 @@ public BeneficiaryCreateResp createIdentity(IdentityDTO identity) throws IEMRExc

logger.info("IdentityService.createIdentity - saving Details");
MBeneficiarydetail mDetl = mapper.identityDTOToMBeneficiarydetail(identity);
if (mDetl.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
mDetl.setCreatedDate(ts);
}
mDetl = detailRepo.save(mDetl);
logger.info("IdentityService.createIdentity - Details saved - id = " + mDetl.getBeneficiaryDetailsId());

// Update van serial no for data sync
int i3 = detailRepo.updateVanSerialNo(mDetl.getBeneficiaryDetailsId());

MBeneficiaryAccount bankOBJ = mapper.identityDTOToMBeneficiaryAccount(identity);
if (bankOBJ.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
bankOBJ.setCreatedDate(ts);
}
bankOBJ = accountRepo.save(bankOBJ);
// Update van serial no for data sync
int i4 = accountRepo.updateVanSerialNo(bankOBJ.getBenAccountID());

MBeneficiaryImage benImageOBJ = mapper.identityDTOToMBeneficiaryImage(identity);
if (benImageOBJ.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
benImageOBJ.setCreatedDate(ts);
}
benImageOBJ = imageRepo.save(benImageOBJ);

// Update van serial no for data sync
Expand Down Expand Up @@ -1031,6 +1076,12 @@ public BeneficiaryCreateResp createIdentity(IdentityDTO identity) throws IEMRExc
// END

regIdRepo.save(regMap);
if (benMapping.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
benMapping.setCreatedDate(ts);
}

benMapping = mappingRepo.save(benMapping);
// Update van serial no for data sync
Expand Down Expand Up @@ -1073,6 +1124,12 @@ public BeneficiaryCreateResp createIdentity(IdentityDTO identity) throws IEMRExc
logger.info("IdentityService.createIdentity - saving Service Map");
MBeneficiaryservicemapping sMap = mapper.identityDTOToMBeneficiaryservicemapping(identity);
sMap.setBenMapId(benMapping.getBenMapId());
if (sMap.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
String DateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(DateToStoreInDataBase);
sMap.setCreatedDate(ts);
}
sMap = serviceMapRepo.save(sMap);
logger.info("IdentityService.createIdentity - ServiceMap saved - id = " + sMap.getBenServiceMapID());

Expand Down