Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3c2135e
Bulk registration
SauravBizbRolly Mar 4, 2025
23cccac
Bulk registration
SauravBizbRolly Mar 11, 2025
83f693e
Bulk registration
SauravBizbRolly Mar 13, 2025
8ae4c09
Merge pull request #69 from toarunmishra/bulk_registration
sushant-bizbrolly Mar 13, 2025
cdd7b2a
add userName and password in Bulk registration
SauravBizbRolly Mar 31, 2025
128c8f9
add userName and password in Bulk registration
SauravBizbRolly Jun 19, 2025
a069382
Merge pull request #88 from toarunmishra/bulk_registration
SauravBizbRolly Jun 19, 2025
3fd079a
Merge remote-tracking branch 'upstream/develop' into enhancement
SauravBizbRolly Jun 19, 2025
fcbc3da
Merge pull request #90 from toarunmishra/3.3.0
drtechie Jun 19, 2025
5cd719d
remove unwanted line
SauravBizbRolly Jun 19, 2025
2a55c54
Merge pull request #91 from toarunmishra/3.3.0
SauravBizbRolly Jun 19, 2025
110fa59
fix code
SauravBizbRolly Jun 21, 2025
83d3387
Merge pull request #92 from toarunmishra/3.3.0
SauravBizbRolly Jun 21, 2025
b1a893f
fix code
SauravBizbRolly Aug 21, 2025
b67332f
fix code
SauravBizbRolly Aug 21, 2025
bdde896
fix code
SauravBizbRolly Aug 21, 2025
5315e05
fix code
SauravBizbRolly Aug 21, 2025
486d412
fix code
SauravBizbRolly Aug 21, 2025
4e5dab6
fix code
SauravBizbRolly Aug 21, 2025
cd7f567
fix code
SauravBizbRolly Aug 21, 2025
f06d077
fix code
SauravBizbRolly Aug 28, 2025
84b679a
fix code
SauravBizbRolly Aug 28, 2025
7b123e9
fix code
SauravBizbRolly Aug 28, 2025
a28294f
fix code
SauravBizbRolly Aug 28, 2025
093ba26
fix code
SauravBizbRolly Aug 28, 2025
8820fe2
Httpheader content disposition changed
ravishanigarapu Sep 2, 2025
2aab70e
Coderabbitai comments adrressed
ravishanigarapu Sep 2, 2025
20eaaed
Httpheader content disposition changed (#100)
ravishanigarapu Sep 2, 2025
e04b9e5
Compile error resolved
ravishanigarapu Sep 2, 2025
bd11453
Merge pull request #101 from PSMRI/feature/signaturerelease
SauravBizbRolly Sep 2, 2025
0addca8
fix code
SauravBizbRolly Sep 2, 2025
b313e03
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly Sep 2, 2025
adc946d
Main branch changes missed (#102)
ravishanigarapu Sep 2, 2025
4e3a304
Feature/signaturerelease (#103)
ravishanigarapu Sep 2, 2025
875e40a
Feature/signaturerelease (#104)
ravishanigarapu Sep 10, 2025
8fb55ce
fix:casesheet signature
vishwab1 Oct 29, 2025
45250ea
fix:pom file change
vishwab1 Oct 30, 2025
c824879
API changes in Signature enhancement for Casesheet (#107)
vishwab1 Oct 30, 2025
7231794
fix: pom version
vishwab1 Oct 30, 2025
e763f9f
Merge pull request #108 from PSMRI/vb/sign
snehar-nd Oct 30, 2025
3d22060
fix code
SauravBizbRolly Nov 7, 2025
226c101
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly Nov 7, 2025
74cd354
fix code
SauravBizbRolly Nov 10, 2025
f719ba5
fix code
SauravBizbRolly Nov 10, 2025
bb00223
fix code
SauravBizbRolly Nov 10, 2025
d52c950
fix code
SauravBizbRolly Nov 10, 2025
86ed8cb
fix code
SauravBizbRolly Nov 10, 2025
3ae6436
fix code
SauravBizbRolly Nov 10, 2025
67a4240
fix code
SauravBizbRolly Nov 10, 2025
f8e646e
fix code
SauravBizbRolly Nov 10, 2025
8c48069
fix code
SauravBizbRolly Nov 11, 2025
5f8dcf2
fix code
SauravBizbRolly Nov 11, 2025
30d3317
fix code
SauravBizbRolly Nov 11, 2025
6f5a101
fix code
SauravBizbRolly Nov 11, 2025
1d45257
Merge branch 'release-3.6.1' into release-3.6.0
5Amogh Nov 17, 2025
0acb505
Merge pull request #109 from PSMRI/release-3.6.0
5Amogh Nov 17, 2025
608773a
fix: amm-1927 send headers only if the request is from the allowed or…
5Amogh Nov 17, 2025
5a7c6bf
fix: amm-1927 coderabbit fixes
5Amogh Nov 17, 2025
ad6ff5e
Update regex handling for localhost URLs
5Amogh Nov 18, 2025
eb98a5a
Enhance regex pattern for URL matching
5Amogh Nov 18, 2025
bffa971
Merge pull request #110 from PSMRI/amm-1927
5Amogh Nov 20, 2025
40eb9fe
Cherry-pick health and version API enhancements to release-3.6.1 (#124)
DurgaPrasad-54 Mar 12, 2026
411bbb1
fix: merge 3.6.1 to main
vanitha1822 Mar 19, 2026
f804273
fix: resolve the conflicts
vanitha1822 Mar 19, 2026
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
20 changes: 12 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.iemr.admin</groupId>
<artifactId>admin-api</artifactId>
<version>3.4.0</version>
<version>3.6.1</version>
<packaging>war</packaging>
<name>Admin-API</name>
<description>Admin Page</description>
Expand Down Expand Up @@ -54,6 +54,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand All @@ -73,6 +77,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down Expand Up @@ -181,12 +190,7 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>

</dependency>

<!-- start newly added dependencies -->
Expand Down Expand Up @@ -280,7 +284,7 @@
</dependencies>

<build>
<finalName>${artifactId}-${version}</finalName>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/iemr/admin/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ public void addCorsMappings(CorsRegistry registry) {
Arrays.stream(allowedOrigins.split(","))
.map(String::trim)
.toArray(String[]::new))
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
.allowedHeaders("*")
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedHeaders("Authorization", "Content-Type", "Accept", "Jwttoken",
"serverAuthorization", "ServerAuthorization", "serverauthorization", "Serverauthorization")
.exposedHeaders("Authorization", "Jwttoken")
.allowCredentials(true)
.maxAge(3600);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package com.iemr.admin.controller.bulkRegistration;

import com.iemr.admin.repo.employeemaster.EmployeeMasterRepoo;
import com.iemr.admin.service.bulkRegistration.BulkRegistrationService;
import com.iemr.admin.service.bulkRegistration.BulkRegistrationServiceImpl;
import com.iemr.admin.service.bulkRegistration.EmployeeXmlService;
import com.iemr.admin.service.locationmaster.LocationMasterServiceInter;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

@RestController
public class BulkRegistrationController {
@Autowired
private EmployeeXmlService employeeXmlService;
@Autowired
BulkRegistrationServiceImpl bulkRegistrationServiceimpl;
private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());


@Autowired
BulkRegistrationService bulkRegistrationService;

@Autowired
private EmployeeMasterRepoo employeeMasterRepoo;
private Map<String, Object> errorResponse = new HashMap<>();
@Autowired
private LocationMasterServiceInter locationMasterServiceInter;
private Map<String, Object> response = new HashMap<>();

@PostMapping(value = "/bulkRegistration", headers = "Authorization")
public ResponseEntity<Map<String, Object>> registerBulkUser(@RequestBody String m_user, @RequestHeader String authorization, @RequestParam String userName,
HttpServletRequest request, @RequestParam Integer serviceProviderID
) {
String jwtToken = null;

Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if ("jwt".equalsIgnoreCase(cookie.getName())) { // Cookie name == jwt
jwtToken = cookie.getValue();
break;
}
}
}

logger.info("JWT Token From Cookie: " + jwtToken);
logger.info("M_user Request: " + m_user);

String authHeader = request.getHeader("Authorization");
logger.info("Authorization Token: " + authHeader);

logger.info("M_user Request: " + m_user);
bulkRegistrationServiceimpl.bulkRegistrationErrors.clear();
logger.info("Bulk registration request received. Request payload is omitted from logs.");
try {
bulkRegistrationService.registerBulkUser(m_user, authorization,userName,serviceProviderID);
response.put("status", "Success");
response.put("statusCode", 200);
response.put("totalUser", bulkRegistrationServiceimpl.totalEmployeeListSize);
response.put("registeredUser", bulkRegistrationServiceimpl.m_bulkUser.size());
response.put("error", bulkRegistrationServiceimpl.errorLogs.toString());

bulkRegistrationServiceimpl.m_bulkUser.clear();
bulkRegistrationServiceimpl.m_UserDemographics.clear();
bulkRegistrationServiceimpl.errorLogs.clear();
bulkRegistrationServiceimpl.totalEmployeeListSize=0;

} catch (Exception e) {
response.put("message", e.getMessage());
response.put("statusCode", 500);

}
return ResponseEntity.ok(response);

}

@GetMapping(value = "/download-error-sheet", headers = "Authorization")
public ResponseEntity<byte[]> downloadErrorSheet() {
try {
byte[] fileContent = bulkRegistrationServiceimpl.insertErrorLog();

HttpHeaders headers = new HttpHeaders();
headers.add("Content-Disposition", "attachment; filename=error_log.xlsx");

if(!bulkRegistrationServiceimpl.bulkRegistrationErrors.isEmpty()){
bulkRegistrationServiceimpl.bulkRegistrationErrors.clear();
}
return ResponseEntity.ok()
.headers(headers)
.contentType(MediaType.APPLICATION_OCTET_STREAM)
.body(fileContent);

} catch (Exception e) {
return ResponseEntity.status(500).body(null);
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.http.MediaType;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.iemr.admin.data.employeemaster.M_Community;
import com.iemr.admin.data.employeemaster.M_Designation;
import com.iemr.admin.data.employeemaster.M_Gender;
Expand Down Expand Up @@ -1051,7 +1050,7 @@ public String getEmployeeByDesignation(@RequestBody String getDesignation) {

ArrayList<M_User1> employeeBydesiganation = employeeMasterInter.getEmployeeByDesiganationID(
employeeMaster.getDesignationID(), employeeMaster1.getServiceProviderID());

response.setResponse(employeeBydesiganation.toString());

} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,34 @@
*/
package com.iemr.admin.controller.employeemaster;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.PropertySource;
import org.springframework.http.ContentDisposition;
import org.springframework.http.HttpHeaders;
import org.springframework.http.InvalidMediaTypeException;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.mapper.InputMapper;
import com.iemr.admin.utils.response.OutputResponse;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.HttpServletRequest;


@PropertySource("classpath:application.properties")
Expand All @@ -54,12 +60,10 @@ public class EmployeeSignatureController {
@Autowired
EmployeeSignatureServiceImpl employeeSignatureServiceImpl;

private InputMapper inputMapper = new InputMapper();

private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());

@Operation(summary = "Upload")
@RequestMapping(value = "/upload", headers = "Authorization", method = { RequestMethod.POST }, produces = {
@PostMapping(value = "/upload", headers = "Authorization", produces = {
"application/json" })
public String uploadFile(@RequestBody EmployeeSignature emp) {
OutputResponse response = new OutputResponse();
Expand All @@ -83,22 +87,27 @@ public String uploadFile(@RequestBody EmployeeSignature emp) {
}

@Operation(summary = "User id")
@RequestMapping(value = "/{userID}", headers = "Authorization", method = { RequestMethod.GET })
@GetMapping(value = "/{userID}", headers = "Authorization")
public ResponseEntity<byte[]> fetchFile(@PathVariable("userID") Long userID) throws Exception {
OutputResponse response = new OutputResponse();
logger.debug("File download for userID" + userID);

try {

EmployeeSignature userSignID = employeeSignatureServiceImpl.fetchSignature(userID);
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.set(HttpHeaders.CONTENT_DISPOSITION,
"inline; filename=\"" + userSignID.getFileName() + "\"");
responseHeaders.set("filename", userSignID.getFileName());

return ResponseEntity.ok().contentType(MediaType.parseMediaType(userSignID.getFileType()))
.headers(responseHeaders).body(userSignID.getSignature());

ContentDisposition cd = ContentDisposition.attachment()
.filename(userSignID.getFileName(), StandardCharsets.UTF_8).build();
responseHeaders.setContentDisposition(cd);

MediaType mediaType;
try {
mediaType = MediaType.parseMediaType(userSignID.getFileType());
} catch (InvalidMediaTypeException | NullPointerException e) {
mediaType = MediaType.APPLICATION_OCTET_STREAM;
}
byte[] fileBytes = userSignID.getSignature(); // MUST be byte[]
return ResponseEntity.ok().headers(responseHeaders).contentType(mediaType).contentLength(fileBytes.length)
.body(fileBytes);
} catch (Exception e) {
logger.error("Unexpected error:", e);
logger.error("File download for userID failed with exception " + e.getMessage(), e);
Expand All @@ -117,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 All @@ -128,4 +145,19 @@ public String existFile(@PathVariable("userID") Long userID) throws Exception {
logger.debug("response" + response);
return response.toString();
}

@Operation(summary = "Active or DeActive user Signature")
@PostMapping(value = "/activateOrdeActivateSignature", headers = "Authorization", produces = { "application/json" })
public String ActivateUser(@RequestBody String activateUser, HttpServletRequest request) {
OutputResponse response = new OutputResponse();
try {
EmployeeSignature empSignature = employeeSignatureServiceImpl.updateUserSignatureStatus(activateUser);
boolean active = empSignature.getDeleted() == null ? false : !empSignature.getDeleted();
response.setResponse("{\"userID\":" + empSignature.getUserID() + ",\"active\":" + active + "}");
} catch (Exception e) {
logger.error("Active or Deactivate User Signature failed with exception " + e.getMessage(), e);
response.setError(e);
}
return response.toString();
}
}
Loading
Loading