Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a7a9518
adding changes related to encryption and decryption
Oct 16, 2024
e1b5318
making final field static
Oct 16, 2024
eddabe3
making enclosing method static
Oct 16, 2024
6e626bb
adding beneficiaryConsent param to createFeedback API
Dec 10, 2024
6cf8550
Merge pull request #6 from PSMRI/develop
srishtigrp78 Dec 10, 2024
2303d60
Update src/main/java/com/iemr/common/data/feedback/FeedbackDetails.java
srishtigrp78 Dec 10, 2024
68d0483
Merge pull request #7 from PSMRI/develop
srishtigrp78 Dec 10, 2024
b7718c0
adding beneficiary consent param feedbacklist response
Dec 11, 2024
f9feef6
adding space
Dec 11, 2024
019d315
Merge pull request #8 from PSMRI/develop
srishtigrp78 Dec 20, 2024
507f830
Merge pull request #9 from PSMRI/develop
srishtigrp78 Jan 8, 2025
21be52e
adding code for schedule for grievance data sync
Jan 9, 2025
0a90728
adding code rabbit code suggestions
Jan 16, 2025
ea9ff9e
adding code rabbit suggestions
Jan 16, 2025
8825473
code rabbit suggested changes to Model classes
Jan 16, 2025
2d639c4
adding sonar quality changes
Jan 16, 2025
b0e039b
adding sonar quality code suggestions
Jan 16, 2025
9831500
adding sonar quality check suggestions
Jan 17, 2025
5cb6886
adding code rabbit suggestions
Jan 17, 2025
9e8e1f2
adding constant instead of duplicate literals
Jan 17, 2025
67b2f86
Merge pull request #10 from PSMRI/develop
srishtigrp78 Jan 19, 2025
7b3b990
adding cod changs to fetch unallocated grievance count
Jan 19, 2025
d834aa9
adding changes suggested by sonar quality check
Jan 20, 2025
734551a
adding code rabbit suggested changes
Jan 20, 2025
47ceb56
fixing config file
Jan 21, 2025
f26b8ff
fixing space
Jan 21, 2025
d3534d9
fixing space issue
Jan 21, 2025
6b58965
adding package for PrimaryDBConfig
Jan 22, 2025
8d97517
Merge pull request #11 from PSMRI/develop
srishtigrp78 Jan 22, 2025
b5798d2
adding code changes for allocate API for allocating grievance to agents
Jan 22, 2025
abe5bd3
removing space
Jan 22, 2025
3c8fbb9
Merge pull request #12 from PSMRI/develop
srishtigrp78 Jan 23, 2025
ef1021e
adding language related changes
Jan 23, 2025
3451ad5
add language related changes
Jan 23, 2025
fa02a49
adding name convention related changes
Jan 24, 2025
822ec19
adding code rabbit changes
Jan 24, 2025
c8e85ab
adding sonar quality check suggested changes
Jan 24, 2025
6557199
removing unused imports
Jan 24, 2025
9c8afce
Merge branch 'PSMRI:develop' into feature/version/upgrade
srishtigrp78 Jan 27, 2025
4c4cce0
Merge pull request #13 from PSMRI/develop
srishtigrp78 Feb 11, 2025
17a159f
Merge pull request #14 from PSMRI/develop
srishtigrp78 Feb 12, 2025
c20c9ab
Merge pull request #16 from PSMRI/develop
srishtigrp78 Feb 19, 2025
b2d99be
adding properties related to Grievance in properties file
Feb 19, 2025
76bf328
placing the placeholder for jwt secret key
Feb 19, 2025
eeaf00d
Update package.yml
srishtigrp78 Feb 19, 2025
b36477c
removing grievanc related properties from application properties file
Feb 20, 2025
48ac080
adding space
Feb 20, 2025
3fe65c4
removing extra space
Feb 20, 2025
b45a6da
Merge branch 'feature/version/upgrade' of https://github.com/srishtig…
Feb 20, 2025
55c469a
adding code for API that fetches grievance outbound worklist
Feb 20, 2025
e6acf34
Merge pull request #17 from PSMRI/develop
srishtigrp78 Feb 20, 2025
584f97e
adding code rabbit suggested changes
Feb 21, 2025
4a4de76
another addition of code rabbit suggested changes
Feb 21, 2025
650e573
fixing row no
Feb 21, 2025
45b088e
adding code for API to save complaint resolution and remarks in the db
Feb 21, 2025
f9ef91b
Merge branch 'feature/version/upgrade' into grievance
srishtigrp78 Feb 21, 2025
0e77f26
Merge pull request #18 from PSMRI/grievance
srishtigrp78 Feb 21, 2025
aaf8db8
adding code rabbit suggested changes
Feb 24, 2025
713867e
removing lastModDate as it will update automatically in db
Feb 24, 2025
42f00ce
changing variable name of assignedUserID to userID
Feb 24, 2025
f2478cd
fixing remarks
Feb 25, 2025
c1cabf6
removing full stop
Feb 25, 2025
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 @@ -87,7 +87,7 @@ public String allocateGrievances(
@Operation(summary = "Allocated Grievance Records Count")
@PostMapping(value = "/allocatedGrievanceRecordsCount", consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String allocatedGrievanceRecordsCount(@Param(value = "{\"providerServiceMapID\":\"Service ID integer\", "
+ "\"assignedUserID\":\"Optional - Integer user ID to whom grievances are assigned\"}") @RequestBody String request) {
+ "\"userID\":\"Optional - Integer user ID to whom grievances are assigned\"}") @RequestBody String request) {
OutputResponse response = new OutputResponse();
try {
response.setResponse(grievanceHandlingService.allocatedGrievanceRecordsCount(request));
Expand Down Expand Up @@ -156,4 +156,27 @@ public ResponseEntity<List<GrievanceWorklistDTO>> getGrievanceOutboundWorklist(@
}



@Operation(summary = "Save complaint resolution and remarks")
@PostMapping(value = "/saveComplaintResolution", consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String saveComplaintResolution( @Param(value = "{\"complaintID\":\"Complaint ID string\", " +
"\"complaintResolution\":\"Resolution text\", " +
"\"remarks\":\"Optional remarks\", " +
"\"beneficiaryRegID\":\"Beneficiary registration ID\", " +
"\"providerServiceMapID\":\"Provider service map ID\", " +
"\"userID\":\"Assigned user ID\", " +
"\"createdBy\":\"Creator of the complaint\", " +
"\"benCallID\":\"Beneficiary call ID\"}")
@RequestBody String request) {
OutputResponse response = new OutputResponse();
try {
response.setResponse(grievanceHandlingService.saveComplaintResolution(request));
} catch (Exception e) {
logger.error("saveComplaintResolution failed with error " + e.getMessage(), e);
response.setError(e);
}
return response.toString();
}


}
18 changes: 15 additions & 3 deletions src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.NoArgsConstructor;

Expand Down Expand Up @@ -81,7 +82,7 @@ public class GrievanceDetails {

@Expose
@Column(name = "userid")
private Integer assignedUserID;
private Integer userID;

@Expose
@Column(name = "isAllocated")
Expand All @@ -106,6 +107,15 @@ public class GrievanceDetails {
@Expose
@Column(name = "PreferredLanguage")
private String preferredLanguage;

@Expose
@Column(name = "ComplaintResolution")
private String complaintResolution;

@Expose
@Column(name = "Remarks")
@Size(max = 5000, message = "Remarks cannot exceed 5000 characters")
private String remarks;

@Column(name = "Deleted", insertable = false, updatable = true)
private Boolean deleted = false;
Expand Down Expand Up @@ -161,7 +171,7 @@ public GrievanceDetails(Long gwid, Long grievanceId, Long beneficiaryRegID, Long
Integer providerServiceMapID, String complaintID, String subjectOfComplaint, String complaint,
String primaryNumber, String severety, String state, String agentID, Integer userid, Boolean isAllocated,
Boolean retryNeeded, Boolean isRegistered, Integer callCounter, Integer preferredLanguageId,
String preferredLanguage, Boolean deleted, Character processed, String createdBy, Timestamp createdDate,
String preferredLanguage, String complaintResolution, String remarks, Boolean deleted, Character processed, String createdBy, Timestamp createdDate,
String modifiedBy, Timestamp lastModDate, Integer vanSerialNo, Integer vanID, String vehicalNo,
Integer parkingPlaceID, String syncedBy, Timestamp syncedDate, Boolean isCompleted) {
super();
Expand All @@ -177,13 +187,15 @@ public GrievanceDetails(Long gwid, Long grievanceId, Long beneficiaryRegID, Long
this.severety = severety;
this.state = state;
this.agentid = agentID;
this.assignedUserID = userid;
this.userID = userid;
this.isAllocated = isAllocated;
this.retryNeeded = retryNeeded;
this.isRegistered = isRegistered;
this.callCounter = callCounter;
this.preferredLanguageId = preferredLanguageId;
this.preferredLanguage = preferredLanguage;
this.complaintResolution = complaintResolution;
this.remarks = remarks;
this.deleted = deleted;
this.processed = processed;
this.createdBy = createdBy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class MoveToBinRequest {

private Integer providerServiceMapID;
private Integer assignedUserID;
private Integer userID;
private String preferredLanguageName;
private Boolean is1097;
private Integer noOfCalls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,40 @@ List<GrievanceDetails> findGrievancesInDateRangeAndLanguage(@Param("startDate")


@Modifying
@Query("UPDATE GrievanceDetails g SET g.isAllocated = true, g.assignedUserID = :assignedUserId WHERE g.grievanceId = :grievanceId")
@Query("UPDATE GrievanceDetails g SET g.isAllocated = true, g.userID = :userId WHERE g.grievanceId = :grievanceId")
@Transactional
public int allocateGrievance(@Param("grievanceId") Long grievanceId,
@Param("assignedUserId") Integer assignedUserId);
@Param("userId") Integer userId);

@Query(nativeQuery = true, value = "SELECT PreferredLanguageId, PreferredLanguage, VanSerialNo, VanID, ParkingPlaceId, VehicalNo FROM db_identity.i_beneficiarydetails WHERE BeneficiaryRegID = :benRegId")
public ArrayList<Object[]> getBeneficiaryGrievanceDetails(@Param("benRegId") Long benRegId);

@Query("select grievance.preferredLanguage, count(distinct grievance.grievanceId) "
+ "from GrievanceDetails grievance " + "where grievance.providerServiceMapID = :providerServiceMapID "
+ "and grievance.assignedUserID = :assignedUserID " + "and grievance.deleted = false "
+ "and grievance.userID = :userID " + "and grievance.deleted = false "
+ "group by grievance.preferredLanguage")
public Set<Object[]> fetchGrievanceRecordsCount(@Param("providerServiceMapID") Integer providerServiceMapID,
@Param("assignedUserID") Integer assignedUserID);
@Param("userID") Integer userID);

@Query("SELECT g FROM GrievanceDetails g WHERE g.assignedUserID = :assignedUserID AND g.preferredLanguage = :language AND g.isAllocated = true")
List<GrievanceDetails> findAllocatedGrievancesByUserAndLanguage(@Param("assignedUserID") Integer assignedUserID,
@Query("SELECT g FROM GrievanceDetails g WHERE g.userID = :userID AND g.preferredLanguage = :language AND g.isAllocated = true")
List<GrievanceDetails> findAllocatedGrievancesByUserAndLanguage(@Param("userID") Integer userID,
@Param("language") String language);

@Modifying
@Query("UPDATE GrievanceDetails g SET g.assignedUserID = :assignedUserID WHERE g.grievanceId = :grievanceId")
@Query("UPDATE GrievanceDetails g SET g.userID = :userID WHERE g.grievanceId = :grievanceId")
@Transactional
public int reallocateGrievance(@Param("grievanceId") Long grievanceId,
@Param("assignedUserID") Integer assignedUserID);
@Param("userID") Integer userID);

@Query("SELECT g FROM GrievanceDetails g WHERE g.assignedUserID = :assignedUserID "
@Query("SELECT g FROM GrievanceDetails g WHERE g.userID = :userID "
+ "AND g.preferredLanguage = :preferredLanguageName")
List<GrievanceDetails> findGrievancesByUserAndLanguage(@Param("assignedUserID") Integer assignedUserID,
List<GrievanceDetails> findGrievancesByUserAndLanguage(@Param("userID") Integer userID,
@Param("preferredLanguageName") String language);

@Modifying
@Transactional
@Query("UPDATE GrievanceDetails g SET g.assignedUserID = NULL WHERE g.grievanceId = :grievanceId AND g.assignedUserID = :assignedUserID")
int unassignGrievance(@Param("grievanceId") Long grievanceId, @Param("assignedUserID") Integer assignedUserID);
@Query("UPDATE GrievanceDetails g SET g.userID = NULL WHERE g.grievanceId = :grievanceId AND g.userID = :userID")
int unassignGrievance(@Param("grievanceId") Long grievanceId, @Param("userID") Integer userID);

@Modifying
@Transactional
Expand All @@ -70,5 +70,30 @@ int updateGrievanceAllocationStatus(@Param("grievanceId") Long grievanceId,

@Query("Select grievance.preferredLanguage, count(grievance) from GrievanceDetails grievance where grievance.isAllocated=false group by grievance.preferredLanguage")
public Set<Object[]> fetchUnallocatedGrievanceCount();

@Modifying
@Query("UPDATE GrievanceDetails g SET g.complaintResolution = :complaintResolution, g.remarks = :remarks, g.modifiedBy = :modifiedBy, "
+ "WHERE g.complaintID = :complaintID AND g.beneficiaryRegID = :beneficiaryRegID AND g.providerServiceMapID = :providerServiceMapID"
+ " AND g.userID = :userID")
@Transactional
int updateComplaintResolution(@Param("complaintResolution") String complaintResolution,
@Param("remarks") String remarks,
@Param("modifiedBy") String modifiedBy,
@Param("complaintID") String complaintID,
@Param("beneficiaryRegID") Long beneficiaryRegID,
@Param("providerServiceMapID") Integer providerServiceMapID,
@Param("userID") Integer userID);

@Modifying
@Query("UPDATE GrievanceDetails g SET g.complaintResolution = :complaintResolution, g.modifiedBy = :modifiedBy, "
+ "WHERE g.complaintID = :complaintID AND g.beneficiaryRegID = :beneficiaryRegID AND g.providerServiceMapID = :providerServiceMapID"
+ " AND g.userID = :userID")
@Transactional
int updateComplaintResolution(@Param("complaintResolution") String complaintResolution,
@Param("modifiedBy") String modifiedBy,
@Param("complaintID") String complaintID,
@Param("beneficiaryRegID") Long beneficiaryRegID,
@Param("providerServiceMapID") Integer providerServiceMapID,
@Param("userID") Integer userID);

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ public interface GrievanceHandlingService {

public List<GrievanceWorklistDTO> getFormattedGrievanceData(String request) throws Exception;

public String saveComplaintResolution(String request) throws Exception;


}
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public String allocatedGrievanceRecordsCount(String request) throws IEMRExceptio
GrievanceDetails grievanceRequest = InputMapper.gson().fromJson(request, GrievanceDetails.class);

Integer providerServiceMapID = grievanceRequest.getProviderServiceMapID();
Integer assignedUserID = grievanceRequest.getAssignedUserID();
Integer userID = grievanceRequest.getUserID();

Set<Object[]> resultSet = grievanceDataRepo.fetchGrievanceRecordsCount(providerServiceMapID, assignedUserID);
Set<Object[]> resultSet = grievanceDataRepo.fetchGrievanceRecordsCount(providerServiceMapID, userID);

JSONObject result = new JSONObject();
result.put("All", 0);
Expand Down Expand Up @@ -194,7 +194,7 @@ public String moveToBin(String request) throws Exception {
// Step 2: Fetch grievances based on assigned user, language
// condition
List<GrievanceDetails> grievances = grievanceDataRepo.findGrievancesByUserAndLanguage(
moveToBinRequest.getAssignedUserID(), moveToBinRequest.getPreferredLanguageName());
moveToBinRequest.getUserID(), moveToBinRequest.getPreferredLanguageName());

if (grievances.isEmpty()) {
throw new Exception("No grievances found for the given user, language, and condition.");
Expand All @@ -220,22 +220,22 @@ public String moveToBin(String request) throws Exception {
int totalUnassigned = 0;
for (GrievanceDetails grievance : grievancesToMove) {
int rowsAffected = grievanceDataRepo.unassignGrievance(grievance.getGrievanceId(),
moveToBinRequest.getAssignedUserID());
moveToBinRequest.getUserID());
if (rowsAffected > 0) {
grievance.setIsAllocated(false); // Assuming there's a setter for this flag
int updateFlagResult = grievanceDataRepo.updateGrievanceAllocationStatus(grievance.getGrievanceId(),
false);
if (updateFlagResult > 0) {
totalUnassigned++;
logger.debug("Unassigned grievance ID {} from user ID {}", grievance.getGrievanceId(),
moveToBinRequest.getAssignedUserID());
moveToBinRequest.getUserID());
} else {
logger.error("Failed to unassign grievance ID {} from user ID {}", grievance.getGrievanceId(),
moveToBinRequest.getAssignedUserID());
moveToBinRequest.getUserID());
}
} else {
logger.error("Failed to unassign grievance ID {} from user ID {}", grievance.getGrievanceId(),
moveToBinRequest.getAssignedUserID());
moveToBinRequest.getUserID());
}
}

Expand Down Expand Up @@ -326,4 +326,65 @@ public List<GrievanceWorklistDTO> getFormattedGrievanceData(String request) thro
return formattedGrievances;

}

/**
* Saves the complaint resolution and remarks for a grievance.
*
* @param request JSON string containing complaint resolution details
* @return Success message if the update is successful
*/

@Transactional
public String saveComplaintResolution(String request) throws Exception {
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot Feb 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

Add transaction management.

The method performs database updates but lacks transaction management. Add @Transactional to ensure atomic operations.

+    @Transactional
     public String saveComplaintResolution(String request) throws Exception {
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public String saveComplaintResolution(String request) throws Exception {
@Transactional
public String saveComplaintResolution(String request) throws Exception {

πŸ› οΈ Refactor suggestion

Add documentation and input validation.

The method would benefit from:

  1. JavaDoc documentation describing its purpose, parameters, return value, and possible exceptions
  2. @NotNull and @NotBlank validation for the request parameter
  3. More specific exception types instead of generic Exception
+    /**
+     * Saves the complaint resolution and remarks for a grievance.
+     *
+     * @param request JSON string containing complaint resolution details
+     * @return Success message if the update is successful
+     * @throws IllegalArgumentException if the request is null or empty
+     * @throws GrievanceUpdateException if the update operation fails
+     */
+    @NotNull
     public String saveComplaintResolution(String request) throws Exception {
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public String saveComplaintResolution(String request) throws Exception {
/**
* Saves the complaint resolution and remarks for a grievance.
*
* @param request JSON string containing complaint resolution details
* @return Success message if the update is successful
* @throws IllegalArgumentException if the request is null or empty
* @throws GrievanceUpdateException if the update operation fails
*/
@NotNull
public String saveComplaintResolution(String request) throws Exception {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srishtigrp78 You're absolutely right. I can confirm that you've already implemented both suggestions:

  1. The @Transactional annotation is present on the saveComplaintResolution method
  2. JavaDoc documentation has been added to describe the method's purpose

Thank you for proactively addressing these code quality improvements!

Comment on lines +337 to +338
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ’‘ Verification agent

🧩 Analysis chain

Add @OverRide annotation if implementing interface method.

If this method is part of the GrievanceHandlingService interface, it should be annotated with @Override to ensure proper implementation and catch any interface changes.


🏁 Script executed:

#!/bin/bash
# Check if saveComplaintResolution is defined in GrievanceHandlingService interface
rg -A 3 "interface GrievanceHandlingService" --include="*.java"
rg "saveComplaintResolution" --include="*GrievanceHandlingService.java"

Length of output: 1021


Verification Concern: Verify whether saveComplaintResolution is an interface method

The initial script couldn’t complete due to invalid command options, so please re-run the search with corrected syntax or perform a manual check. For example, try:

If you confirm that saveComplaintResolution is declared in the GrievanceHandlingService interface, please add the @Override annotation in the method implementation in the file src/main/java/com/iemr/common/service/grievance/GrievanceHandlingServiceImpl.java at lines 337-338 to ensure proper interface contract adherence.


🏁 Script executed:

[run_scripts]
#!/bin/bash
# Search for the interface declaration and its context
rg -A 3 "interface GrievanceHandlingService" -g "*.java"

# Search for the method usage in files related to GrievanceHandlingService
rg "saveComplaintResolution" -g "*GrievanceHandlingService.java"

Length of output: 924


Action Required: Add @OverRide Annotation

We verified that saveComplaintResolution is declared in the GrievanceHandlingService interface (see file: src/main/java/com/iemr/common/service/grievance/GrievanceHandlingService.java). Therefore, the implementation in src/main/java/com/iemr/common/service/grievance/GrievanceHandlingServiceImpl.java (lines 337-338) should include the @Override annotation to ensure contract consistency. For example:

@Override
@Transactional
public String saveComplaintResolution(String request) throws Exception {
    // method implementation
}

This change will help catch interface changes during compilation.

// Parse the request JSON into a GrievanceDetails object
GrievanceDetails grievanceRequest = InputMapper.gson().fromJson(request, GrievanceDetails.class);

if (grievanceRequest.getComplaintID() == null || grievanceRequest.getComplaintID().trim().isEmpty()) {
throw new IllegalArgumentException("ComplaintID is required");
}
if (grievanceRequest.getComplaintResolution() == null || grievanceRequest.getComplaintResolution().trim().isEmpty()) {
throw new IllegalArgumentException("ComplaintResolution is required");
}
if (grievanceRequest.getBeneficiaryRegID() == null) {
throw new IllegalArgumentException("BeneficiaryRegID is required");
}
if (grievanceRequest.getProviderServiceMapID() == null) {
throw new IllegalArgumentException("ProviderServiceMapID is required");
}
if (grievanceRequest.getUserID() == null) {
throw new IllegalArgumentException("AssignedUserID is required");
}
if (grievanceRequest.getCreatedBy() == null) {
throw new IllegalArgumentException("CreatedBy is required");
}
// Extract values from the request
String complaintID = grievanceRequest.getComplaintID();
String complaintResolution = grievanceRequest.getComplaintResolution();
String remarks = grievanceRequest.getRemarks();
Long beneficiaryRegID = grievanceRequest.getBeneficiaryRegID();
Integer providerServiceMapID = grievanceRequest.getProviderServiceMapID();
Integer userID = grievanceRequest.getUserID();
String createdBy = grievanceRequest.getCreatedBy();


String modifiedBy = createdBy;
int updateCount = 0;
if (remarks == null) {
updateCount = grievanceDataRepo.updateComplaintResolution(complaintResolution, modifiedBy, complaintID,
beneficiaryRegID, providerServiceMapID, userID);
logger.debug("updated complaint resolution without remarks for complaint id: {}", complaintID);
}
else {
updateCount = grievanceDataRepo.updateComplaintResolution(complaintResolution, remarks, modifiedBy, complaintID,
beneficiaryRegID, providerServiceMapID, userID);
logger.debug("updated complaint resolution with remarks for complaint id: {}", complaintID);

}
if (updateCount > 0) {
return "Complaint resolution updated successfully";
} else {
throw new Exception("Failed to update complaint resolution");
}
}

}
Loading