Package org.sis.ancmessaging.json

Examples of org.sis.ancmessaging.json.CustomHealthWorkerResponse


  }
 
  @RequestMapping(value = "gethealthworkers", method = RequestMethod.GET)
  public @ResponseBody CustomHealthWorkerResponse fetchHealthWorkers(@RequestParam("postId") int postId,
      @RequestParam("rows") int rows, @RequestParam("page") int page) {
    CustomHealthWorkerResponse response = new CustomHealthWorkerResponse();
    //HealthPost healthPost = healthPostService.findById(postId);
    StringBuilder sb = new StringBuilder();
    List<HealthExtensionWorker> healthWorkers = healthPostService.getHealthWorkersForHealthPost(postId, rows, page, sb);
    List<HealthWorkerDTO> healthWorkerDTOs = new ArrayList<HealthWorkerDTO>();
    for (HealthExtensionWorker healthWorker : healthWorkers) {
      HealthWorkerDTO hDTO = new HealthWorkerDTO();
      hDTO.setWorkerId(healthWorker.getWorkerId());
      hDTO.setFullName(healthWorker.getFullName());
      hDTO.setPhoneNumber(healthWorker.getPhoneNumber());
      hDTO.setPostId(postId);
      hDTO.setSex(healthWorker.getSex());
      healthWorkerDTOs.add(hDTO);
    }
    response.setPage(String.valueOf(page));
    response.setRows(healthWorkerDTOs);
    response.setTotal(sb.toString());
    response.setRecords(String.valueOf(healthWorkerDTOs.size()));
    return response;
  }
View Full Code Here

TOP

Related Classes of org.sis.ancmessaging.json.CustomHealthWorkerResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.