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
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.iemr.admin</groupId>
<artifactId>adminapi</artifactId>
<version>v3.1.0</version>
<artifactId>admin-api</artifactId>
<version>3.6.0</version>
<packaging>war</packaging>
<name>Admin-API</name>
<description>Admin Page</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.google.gson.JsonObject;
import com.iemr.admin.data.employeemaster.EmployeeSignature;
import com.iemr.admin.service.employeemaster.EmployeeSignatureServiceImpl;
import com.iemr.admin.utils.response.OutputResponse;
Expand Down Expand Up @@ -125,7 +126,15 @@ public String existFile(@PathVariable("userID") Long userID) throws Exception {
try {

Boolean userSignID = employeeSignatureServiceImpl.existSignature(userID);
response.setResponse(userSignID.toString());
Boolean signatureActive = employeeSignatureServiceImpl.isSignatureActive(userID);

// Create JSON response with both fields
JsonObject responseData = new JsonObject();
responseData.addProperty("response", userSignID.toString());
responseData.addProperty("signStatus", signatureActive.toString());

// Set the response (existing setResponse method will handle it)
response.setResponse(responseData.toString());

} catch (Exception e) {
logger.error("Unexpected error:", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public interface EmployeeSignatureRepo extends CrudRepository<EmployeeSignature,

Long countByUserIDAndSignatureNotNull(Long userID);


Long countByUserIDAndSignatureNotNullAndDeletedFalse(Long userID);

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ public EmployeeSignature fetchSignature(Long userSignID) {

public Boolean existSignature(Long userID) {
// TODO Auto-generated method stub
return employeeSignatureRepo.countByUserIDAndSignatureNotNull(userID)>0;
return employeeSignatureRepo.countByUserIDAndSignatureNotNull(userID) > 0;
}

public Boolean isSignatureActive(Long userID) {
return employeeSignatureRepo.countByUserIDAndSignatureNotNullAndDeletedFalse(userID) > 0;
}

@Override
Expand Down