Subversion Repository Public Repository

emr_demo

Diff Revisions 5 vs 6 for /web_emr - Copy/src/main/java/com/bestray/security/controller/FacilitySetupController.java

Diff revisions: vs.
  @@ -26,6 +26,7 @@
26 26 import com.bestray.security.service.FacilityMasterService;
27 27 import com.bestray.security.service.JwtUserDetailsService;
28 28 import com.fasterxml.jackson.core.JsonProcessingException;
29 + import com.fasterxml.jackson.databind.ObjectMapper;
29 30
30 31 @RestController
31 32 public class FacilitySetupController {
  @@ -227,10 +228,22 @@
227 228 return new ResponseEntity(HttpStatus.OK);
228 229 }
229 230
230 - // //searchExpenditure
231 - // @RequestMapping(value = "${jwt.route.labsearch.path}", method = RequestMethod.POST)
232 - // public ResponseEntity searchExpenditure() throws AuthenticationException, ExceptionHandler_delete, JsonProcessingException{
233 - // String json=facilityMasterService.searchExpenditure();
234 - // return new ResponseEntity(json,HttpStatus.OK);
235 - // }
231 + //searchExpenditure
232 + @RequestMapping(value = "${jwt.route.expendituresearch.path}", method = RequestMethod.POST)
233 + public ResponseEntity searchExpenditure(@QueryParam("name") String name) throws AuthenticationException, ExceptionHandler_delete, JsonProcessingException{
234 + System.out.println("->>>>"+name);
235 + ExpenditureMaster expenditureMaster=new ExpenditureMaster();
236 + String json=null;
237 + if(name!=null){
238 + expenditureMaster=facilityMasterService.searchByNameExpenditure(name);
239 + json = new ObjectMapper()
240 + .writeValueAsString(expenditureMaster);
241 +
242 + }else{
243 + json=facilityMasterService.searchExpenditure();
244 + }
245 +
246 +
247 + return new ResponseEntity(json,HttpStatus.OK);
248 + }
236 249 }