|
21 | 21 | */
|
22 | 22 | package com.iemr.ecd.controller.outboundworklist;
|
23 | 23 |
|
| 24 | +import java.text.SimpleDateFormat; |
24 | 25 | import java.util.List;
|
25 | 26 |
|
26 | 27 | import org.springframework.beans.factory.annotation.Autowired;
|
|
33 | 34 | import org.springframework.web.bind.annotation.RequestMapping;
|
34 | 35 | import org.springframework.web.bind.annotation.RestController;
|
35 | 36 |
|
| 37 | +import com.fasterxml.jackson.core.JsonProcessingException; |
| 38 | +import com.fasterxml.jackson.databind.ObjectMapper; |
36 | 39 | import com.iemr.ecd.dao_temp.FetchChildOutboundWorklist;
|
37 | 40 | import com.iemr.ecd.dao_temp.FetchMotherOutboundWorklist;
|
38 | 41 | import com.iemr.ecd.service.outbound_worklist.OutboundWorkListServiceImpl;
|
@@ -60,8 +63,12 @@ public class OutBoundWorklistController {
|
60 | 63 | @ApiResponse(responseCode = CustomExceptionResponse.INTERNAL_SERVER_ERROR_SC_V, description = CustomExceptionResponse.INTERNAL_SERVER_ERROR_SC),
|
61 | 64 | @ApiResponse(responseCode = CustomExceptionResponse.DB_EXCEPTION_SC_V, description = CustomExceptionResponse.DB_EXCEPTION_SC),
|
62 | 65 | @ApiResponse(responseCode = CustomExceptionResponse.BAD_REQUEST_SC_V, description = CustomExceptionResponse.BAD_REQUEST_SC) })
|
63 |
| - public ResponseEntity<List<FetchMotherOutboundWorklist>> getMotherWorklist(@PathVariable int userId) { |
64 |
| - return new ResponseEntity<>(outboundWorkListServiceImpl.getMotherWorkList(userId), HttpStatus.OK); |
| 66 | + public ResponseEntity<String> getMotherWorklist(@PathVariable int userId) throws JsonProcessingException { |
| 67 | + List<FetchMotherOutboundWorklist> motherWorkList = outboundWorkListServiceImpl.getMotherWorkList(userId); |
| 68 | + ObjectMapper objectMapper = new ObjectMapper(); |
| 69 | + objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); |
| 70 | + String resp = objectMapper.writeValueAsString(motherWorkList); |
| 71 | + return new ResponseEntity<>(resp,HttpStatus.OK); |
65 | 72 | }
|
66 | 73 |
|
67 | 74 | @GetMapping(value = "/get-child-data/{userId}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
0 commit comments