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 @@ -57,7 +57,7 @@ public class RMNCHBornBirthDetails {

@Expose
@Column(name = "beneficiaryId")
private Integer beneficiaryId;
private Long benficieryid;

@Expose
@Column(name = "countryid")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public class RMNCHCBACdetails {

@Expose
@Column(name = "beneficiaryId")
private Integer beneficiaryid;
private Long benficieryid;

// new fields, 16-09-2021
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ public String syncDataToAmrit(String requestOBJ) throws Exception {
List<RMNCHBeneficiaryDetailsRmnch> benDetailsExtraList = Arrays.asList(objArr);

if (benDetailsExtraList != null && benDetailsExtraList.size() > 0) {
benRegID = rMNCHMBenRegIdMapRepo.getRegID(benDetailsExtraList.get(0).getBenficieryid());

if (benRegID != null) {
// benRegID = rMNCHMBenRegIdMapRepo.getRegID(benDetailsExtraList.get(0).getBenficieryid());
//
// if (benRegID != null) {

for (RMNCHBeneficiaryDetailsRmnch obj : benDetailsExtraList) {
benRegID = rMNCHMBenRegIdMapRepo.getRegID(obj.getBenficieryid());
obj.setBenRegId(benRegID);
RMNCHBeneficiaryDetailsRmnch temp = rMNCHBeneficiaryDetailsRmnchRepo
.getByRegID(benRegID);
Expand All @@ -164,22 +166,24 @@ public String syncDataToAmrit(String requestOBJ) throws Exception {
}
obj.setRelatedBeneficiaryIdsDB(sb.toString());
}


}

benDetailsExtraList = (ArrayList<RMNCHBeneficiaryDetailsRmnch>) rMNCHBeneficiaryDetailsRmnchRepo
.save(benDetailsExtraList);

benDetailsExtraList.forEach((n) -> beneficiaryDetailsIds.add(n.getId()));
} else
throw new Exception("invalid/empty beneficiary request data.");
// } else
// throw new Exception("invalid/empty beneficiary request data.");

// born birth details
if (jsnOBJ != null && jsnOBJ.has("bornBirthDeatils") && benRegID != null) {
if (jsnOBJ != null && jsnOBJ.has("bornBirthDeatils")) {
RMNCHBornBirthDetails[] objArr1 = InputMapper.gson()
.fromJson(jsnOBJ.get("bornBirthDeatils"), RMNCHBornBirthDetails[].class);
List<RMNCHBornBirthDetails> bornBirthList = Arrays.asList(objArr1);
for (RMNCHBornBirthDetails obj : bornBirthList) {
benRegID = rMNCHMBenRegIdMapRepo.getRegID(obj.getBenficieryid());
obj.setBenRegId(benRegID);
RMNCHBornBirthDetails temp = rMNCHBornBirthDetailsRepo.getByRegID(benRegID);
if (temp != null)
Expand All @@ -197,6 +201,7 @@ public String syncDataToAmrit(String requestOBJ) throws Exception {
List<RMNCHCBACdetails> cbacList = Arrays.asList(objArr2);

for (RMNCHCBACdetails obj : cbacList) {
benRegID = rMNCHMBenRegIdMapRepo.getRegID(obj.getBenficieryid());
obj.setBenRegId(benRegID);
obj.setConfirmed_hrp("Not checked");
obj.setConfirmed_ncd("Not checked");
Expand Down