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,6 +66,7 @@ public String syncDataToAmrit(@RequestBody String requestOBJ) {
response.setError(5000, "Invalid/NULL request obj");
} catch (Exception e) {
logger.error("Error in RMNCH mobile data sync : {} " , e.getMessage());
e.printStackTrace();
response.setError(5000, "Error in RMNCH mobile data sync : " + e);
}
return response.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
package com.iemr.common.identity.repo.rmnch;

import java.math.BigInteger;
import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
Expand All @@ -37,5 +38,5 @@ public RMNCHBeneficiaryDetailsRmnch getByIdAndVanID(@Param("vanSerialNo") BigInt
@Param("vanID") int vanID);

@Query(" SELECT t FROM RMNCHBeneficiaryDetailsRmnch t WHERE t.BenRegId =:benRegID ")
public RMNCHBeneficiaryDetailsRmnch getByRegID(@Param("benRegID") BigInteger benRegId);
public List<RMNCHBeneficiaryDetailsRmnch> getByRegID(@Param("benRegID") BigInteger benRegId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
package com.iemr.common.identity.repo.rmnch;

import java.math.BigInteger;
import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ private MBeneficiarymapping getBeneficiariesDTONew(Object[] benMapArr) {

BigInteger benRegId = new BigInteger(benMapArr[5].toString());
RMNCHBeneficiaryDetailsRmnch obj = rMNCHBeneficiaryDetailsRmnchRepo
.getByRegID(benRegId);
.getByRegID(benRegId).get(0);

if (obj != null) {
if (obj.getHouseoldId() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
Expand Down Expand Up @@ -148,7 +145,7 @@
benRegID = rMNCHMBenRegIdMapRepo.getRegID(obj.getBenficieryid());
obj.setBenRegId(benRegID);
RMNCHBeneficiaryDetailsRmnch temp = rMNCHBeneficiaryDetailsRmnchRepo
.getByRegID(benRegID);
.getByRegID(benRegID).get(0);
if (temp != null) {
obj.setBeneficiaryDetails_RmnchId(temp.getBeneficiaryDetails_RmnchId());
}
Expand Down Expand Up @@ -257,7 +254,8 @@
} catch (

Exception e) {
throw new Exception(e.getMessage());
throw new Exception(e); // βœ… original exception wrap karo

Check warning on line 257 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Identity-API&issues=AZ6R8LmaSoZLY4yFQWGB&open=AZ6R8LmaSoZLY4yFQWGB&pullRequest=164

}
resultMap.put("beneficiaryDetails", beneficiaryDetailsIds);
resultMap.put("bornBirthDeatils", bornBirthDeatilsIds);
Expand Down Expand Up @@ -407,7 +405,7 @@

if (m.getBenRegId() != null) {
benDetailsRMNCHOBJ = rMNCHBeneficiaryDetailsRmnchRepo
.getByRegID(m.getBenRegId());
.getByRegID(m.getBenRegId()).get(0);
benBotnBirthRMNCHROBJ = rMNCHBornBirthDetailsRepo.getByRegID(m.getBenRegId());

benCABCRMNCHROBJ = rMNCHCBACDetailsRepo.getByRegID(m.getBenRegId());
Expand Down
Loading