Update controller
Clean code
This commit is contained in:
parent
776ffe55a3
commit
711084879d
@ -1,173 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.jasamedika.medifirst2000.controller.base.IBaseRestController;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.service.LaundryService;
|
||||
import com.jasamedika.medifirst2000.service.SaranaPrasaranaReportingService;
|
||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
||||
import com.jasamedika.medifirst2000.vo.RegistrasiPelayananVO;
|
||||
|
||||
/**
|
||||
* Controller class for Sarana Prasarana Business
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sarana-prasarana-reporting")
|
||||
public class SaranaPrasaranaReportingController extends LocaleController<RegistrasiPelayananVO>
|
||||
implements IBaseRestController<RegistrasiPelayananVO> {
|
||||
|
||||
@Autowired
|
||||
private SaranaPrasaranaReportingService saranaPrasaranaReportingService;
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/lapDaftarPengeringan")
|
||||
public ModelAndView generateDaftarPengeringan(ModelAndView m,
|
||||
@RequestParam(value = "startPeriode", required = true) String startPeriode,
|
||||
@RequestParam(value = "endPeriode", required = true) String endPeriode,
|
||||
@RequestParam(value = "format", required = false) String format) {
|
||||
|
||||
Map<String, Object> result = saranaPrasaranaReportingService.getDaftarPengeringan(startPeriode,endPeriode);
|
||||
|
||||
m.addObject("dataSource", result.get("daftarPengeringan"));
|
||||
m.addObject("startPeriode", startPeriode);
|
||||
m.addObject("endPeriode", endPeriode);
|
||||
m.addObject("format", "pdf");
|
||||
|
||||
|
||||
if (format != null && !format.isEmpty()) {
|
||||
m.addObject("format", format);
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
@RequestMapping("/daftarPengambilanLinenKotor")
|
||||
public ModelAndView generateDaftarPengambilanLinenKotor(ModelAndView m,
|
||||
@RequestParam(value = "startPeriode", required = true) String startPeriode,
|
||||
@RequestParam(value = "endPeriode", required = true) String endPeriode,
|
||||
@RequestParam(value = "format", required = false) String format) {
|
||||
Map<String, Object> result = saranaPrasaranaReportingService.getDaftarPengambilanLinenKotor(startPeriode,endPeriode);
|
||||
|
||||
m.addObject("dataSource", result.get("pengambilanLinenKotor"));
|
||||
m.addObject("startPeriode", startPeriode);
|
||||
m.addObject("endPeriode", endPeriode);
|
||||
m.addObject("format", "pdf");
|
||||
|
||||
|
||||
if (format != null && !format.isEmpty()) {
|
||||
m.addObject("format", format);
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
@RequestMapping("/daftarPermintaanPerbaikanDariRuangan")
|
||||
public ModelAndView generateDaftarPermintaanPerbaikanDariRuangan(ModelAndView m,
|
||||
@RequestParam(value = "startPeriode", required = true) String startPeriode,
|
||||
@RequestParam(value = "endPeriode", required = true) String endPeriode,
|
||||
@RequestParam(value = "format", required = false) String format) {
|
||||
Map<String, Object> result = saranaPrasaranaReportingService.getAllPermintaanPerbaikan(startPeriode,endPeriode);
|
||||
|
||||
m.addObject("dataSource", result.get("permintaanPerbaikan"));
|
||||
m.addObject("startPeriode", startPeriode);
|
||||
m.addObject("endPeriode", endPeriode);
|
||||
m.addObject("format", "pdf");
|
||||
|
||||
|
||||
if (format != null && !format.isEmpty()) {
|
||||
m.addObject("format", format);
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Collection<RegistrasiPelayananVO>> getAllVOWithQueryString(HttpServletRequest request,
|
||||
Integer page, Integer limit, String sort, String dir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<RegistrasiPelayananVO> getVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> addVO(RegistrasiPelayananVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> editVO(RegistrasiPelayananVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> deleteVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<List<RegistrasiPelayananVO>> getAllVO() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private String formatBulan(Integer bulan) {
|
||||
String bulanString = "";
|
||||
switch (bulan) {
|
||||
case 1:
|
||||
bulanString = "januari";
|
||||
break;
|
||||
case 2:
|
||||
bulanString = "februari";
|
||||
break;
|
||||
case 3:
|
||||
bulanString = "maret";
|
||||
break;
|
||||
case 4:
|
||||
bulanString = "april";
|
||||
break;
|
||||
case 5:
|
||||
bulanString = "mei";
|
||||
break;
|
||||
case 6:
|
||||
bulanString = "juni";
|
||||
break;
|
||||
case 7:
|
||||
bulanString = "juli";
|
||||
break;
|
||||
case 8:
|
||||
bulanString = "agustus";
|
||||
break;
|
||||
case 9:
|
||||
bulanString = "september";
|
||||
break;
|
||||
case 10:
|
||||
bulanString = "oktober";
|
||||
break;
|
||||
case 11:
|
||||
bulanString = "november";
|
||||
break;
|
||||
case 12:
|
||||
bulanString = "desember";
|
||||
break;
|
||||
}
|
||||
return bulanString;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,194 +1,119 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.data.jpa.domain.Specifications;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.IBaseRestController;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.entities.SasaranStrategis;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SasaranStrategisService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
||||
import com.jasamedika.medifirst2000.vo.SasaranStrategisVO;
|
||||
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.Equal;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.GreaterThanOrEqual;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.LessThanOrEqual;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.Spec;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.data.jpa.domain.Specifications;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sasaran-strategis")
|
||||
public class SasaranStrategisController extends LocaleController<SasaranStrategisVO> implements
|
||||
IBaseRestController<SasaranStrategisVO> {
|
||||
|
||||
public class SasaranStrategisController extends LocaleController<SasaranStrategisVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SasaranStrategisController.class);
|
||||
|
||||
@Autowired
|
||||
private SasaranStrategisService sasaranStrategisService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
.getLogger(SasaranStrategisController.class);
|
||||
|
||||
@RequestMapping(value = "/save-sasaran-strategis/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> addVO(@Valid @RequestBody SasaranStrategisVO vo, HttpServletRequest request) {
|
||||
|
||||
|
||||
@RequestMapping(value = "/save-sasaran-strategis/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> addVO(@Valid @RequestBody SasaranStrategisVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result=sasaranStrategisService.addSasaranStrategis(vo);
|
||||
Map<String, Object> result = sasaranStrategisService.addSasaranStrategis(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add Sasaran Strategis", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when addSasaranStrategis", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add Sasaran Strategis", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when addSasaranStrategis", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update-sasaran-strategis/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> updateVO(@Valid @RequestBody SasaranStrategisVO vo, HttpServletRequest request) {
|
||||
|
||||
|
||||
@RequestMapping(value = "/find-all-sasaran-strategis/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getAllVO(HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result=sasaranStrategisService.updateSasaranStrategis(vo);
|
||||
Map<String, Object> result = sasaranStrategisService.findAllSasaranStrategis();
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add Sasaran Strategis", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when findAllSasaranStrategis", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add Sasaran Strategis", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when findAllSasaranStrategis", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-all-sasaran-strategis/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> getAllVO(HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
Map<String,Object> result=sasaranStrategisService.findAllSasaranStrategis();
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when get all sasaran strategis", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when get all sasaran strategis", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value="/find-all/", method= RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Collection<SasaranStrategis>> findAll(
|
||||
|
||||
@RequestMapping(value = "/find-all/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Collection<PasienVO>> findAll(
|
||||
@RequestParam(value = "page", required = false, defaultValue = "0") Integer page,
|
||||
@RequestParam(value = "take", required = false, defaultValue = "100") Integer take,
|
||||
@RequestParam(value = "sort", required = false, defaultValue = "id") String sort,
|
||||
@RequestParam(value = "dir", required = false, defaultValue = "asc") String dir,
|
||||
@Spec(path = "awalPeriode", params = "awalPeriode", spec = GreaterThanOrEqual.class) Specification<SasaranStrategis> awalPeriode,
|
||||
@Spec(path = "akhirPeriode",params="akhirPeriode", spec= LessThanOrEqual.class) Specification<SasaranStrategis> akhirPeriode,
|
||||
@Spec(path = "perspektifId",params="perspektifId", spec= Equal.class) Specification<SasaranStrategis> perspektifId)
|
||||
{
|
||||
Specification<SasaranStrategis> spec = Specifications.where(awalPeriode).and(akhirPeriode).and(perspektifId);
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result = sasaranStrategisService.findAll(page, take, sort,dir, spec);
|
||||
return constructListPageResult(result);
|
||||
@Spec(path = "akhirPeriode", params = "akhirPeriode", spec = LessThanOrEqual.class) Specification<SasaranStrategis> akhirPeriode,
|
||||
@Spec(path = "perspektifId", params = "perspektifId", spec = Equal.class) Specification<SasaranStrategis> perspektifId) {
|
||||
Specification<SasaranStrategis> spec = Specifications.where(awalPeriode).and(akhirPeriode).and(perspektifId);
|
||||
Map<String, Object> result = sasaranStrategisService.findAll(page, take, sort, dir, spec);
|
||||
return constructListPageResult(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/generate-kode/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> generateKode(
|
||||
@RequestParam(value="perspektifId",required=true) Integer perspektifId,
|
||||
|
||||
@RequestMapping(value = "/generate-kode/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> generateKode(@RequestParam(value = "perspektifId") Integer perspektifId,
|
||||
HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
Map<String,Object> result=sasaranStrategisService.generateCode(perspektifId);
|
||||
Map<String, Object> result = sasaranStrategisService.generateCode(perspektifId);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when get all sasaran strategis", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when sasaranStrategisService.generateCode", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when get all sasaran strategis", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when sasaranStrategisService.generateCode", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Collection<SasaranStrategisVO>> getAllVOWithQueryString(HttpServletRequest request,
|
||||
Integer page, Integer limit, String sort, String dir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<SasaranStrategisVO> getVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> addVO(SasaranStrategisVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> editVO(SasaranStrategisVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> deleteVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<List<SasaranStrategisVO>> getAllVO() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,118 +1,76 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.entities.SatuanIndikator;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SatuanIndikatorService;
|
||||
import com.jasamedika.medifirst2000.vo.PasienVO;
|
||||
import com.jasamedika.medifirst2000.vo.SatuanIndikatorVO;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.Equal;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.Spec;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.IBaseRestController;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.entities.SatuanIndikator;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SatuanIndikatorService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SatuanIndikatorVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.Equal;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.Spec;
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/satuan-indikator")
|
||||
public class SatuanIndikatorController extends LocaleController<SatuanIndikatorVO>
|
||||
implements IBaseRestController<SatuanIndikatorVO>{
|
||||
public class SatuanIndikatorController extends LocaleController<SatuanIndikatorVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SatuanIndikatorController.class);
|
||||
|
||||
@Autowired
|
||||
private SatuanIndikatorService satuanService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
.getLogger(IndikatorRensarController.class);
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Collection<SatuanIndikatorVO>> getAllVOWithQueryString(HttpServletRequest request,
|
||||
Integer page, Integer limit, String sort, String dir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<SatuanIndikatorVO> getVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> addVO(SatuanIndikatorVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> editVO(SatuanIndikatorVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> deleteVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<List<SatuanIndikatorVO>> getAllVO() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/find-all/", method= RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Collection<SatuanIndikator>> findAll(
|
||||
@RequestMapping(value = "/find-all/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Collection<PasienVO>> findAll(
|
||||
@RequestParam(value = "page", required = false, defaultValue = "0") Integer page,
|
||||
@RequestParam(value = "take", required = false, defaultValue = "100") Integer take,
|
||||
@RequestParam(value = "sort", required = false, defaultValue = "id") String sort,
|
||||
@RequestParam(value = "dir", required = false, defaultValue = "asc") String dir,
|
||||
@Spec(path = "id", params = "id", spec = Equal.class) Specification<SatuanIndikator> spec)
|
||||
{
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result = satuanService.findAll(page, take, sort,dir, spec);
|
||||
return constructListPageResult(result);
|
||||
@Spec(path = "id", params = "id", spec = Equal.class) Specification<SatuanIndikator> spec) {
|
||||
Map<String, Object> result = satuanService.findAll(page, take, sort, dir, spec);
|
||||
return constructListPageResult(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value="/save/", method= RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> save(@Valid @RequestBody SatuanIndikatorVO vo,HttpServletRequest request){
|
||||
try{
|
||||
@RequestMapping(value = "/save/", method = POST, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> save(@Valid @RequestBody SatuanIndikatorVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = satuanService.save(vo);
|
||||
if(null!= result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add/update Satuann Indikator", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
LOGGER.error("Got ServiceVOException {} when satuanService.save", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add/update Satuan Indikator", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when satuanService.save", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,140 +1,57 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SatuanStandarService;
|
||||
import com.jasamedika.medifirst2000.vo.SatuanStandarVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.IBaseRestController;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SatuanStandarService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SatuanStandarVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/satuan-standar")
|
||||
public class SatuanStandarController extends LocaleController<SatuanStandarVO> implements IBaseRestController<SatuanStandarVO>{
|
||||
|
||||
public class SatuanStandarController extends LocaleController<SatuanStandarVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SatuanStandarController.class);
|
||||
|
||||
@Autowired
|
||||
private SatuanStandarService satuanStandarService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SatuanStandarController.class);
|
||||
|
||||
@RequestMapping(value = "/save-satuan-standar/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> addVO(@Valid @RequestBody SatuanStandarVO vo, HttpServletRequest request) {
|
||||
|
||||
|
||||
@RequestMapping(value = "/save-satuan-standar/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> addVO(@Valid @RequestBody SatuanStandarVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result=satuanStandarService.addSatuanStandar(vo);
|
||||
Map<String, Object> result = satuanStandarService.addSatuanStandar(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add SatuanStandar", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when addSatuanStandar", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add SatuanStandar", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when addSatuanStandar", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update-satuan-standar/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> updateVO(@Valid @RequestBody SatuanStandarVO vo, HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
Map<String,Object> result=satuanStandarService.updateSatuanStandar(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when update SatuanStandar", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when update SatuanStandar", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-all-satuan-standar/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> getAllVO(HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
Map<String,Object> result=satuanStandarService.findAllSatuanStandar();
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when get all sasaran strategis", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when get all sasaran strategis", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Collection<SatuanStandarVO>> getAllVOWithQueryString(HttpServletRequest request, Integer page,
|
||||
Integer limit, String sort, String dir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<SatuanStandarVO> getVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> addVO(SatuanStandarVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> editVO(SatuanStandarVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> deleteVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<List<SatuanStandarVO>> getAllVO() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.service.SchedulerService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.AssetVO;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/scheduler")
|
||||
public class SchedulerController extends LocaleController<AssetVO>{
|
||||
@Autowired
|
||||
private SchedulerService schedulerService;
|
||||
|
||||
@RequestMapping(value = "/get-akomodasi-rawat-inap", method = RequestMethod.GET)
|
||||
public ResponseEntity<Map<String,Object>> getAkomodasiRawatInap() {
|
||||
Map<String,Object> result = new HashMap<String,Object>();
|
||||
schedulerService.runAkomodasiRawatInap();
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -17,7 +17,7 @@ import java.util.List;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttptatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
@ -47,7 +47,7 @@ public class SettingDataFixedController extends LocaleController<SettingDataFixe
|
||||
} catch (ServiceVOException | JpaSystemException e) {
|
||||
LOGGER.error("Got exception {} when settingDataFixedService.getSetting", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttptatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,118 +1,96 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SewaAsramaService;
|
||||
import com.jasamedika.medifirst2000.vo.SewaAsramaVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SewaAsramaService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SewaAsramaVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sewa-asrama")
|
||||
public class SewaAsramaController extends LocaleController<SewaAsramaVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SewaAsramaController.class);
|
||||
|
||||
@Autowired
|
||||
private SewaAsramaService sewaAsramaService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SewaAsramaController.class);
|
||||
|
||||
@RequestMapping(value = "/save-sewa-asrama/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@RequestMapping(value = "/save-sewa-asrama/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> saveSewaAsrama(@Valid @RequestBody SewaAsramaVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = sewaAsramaService.saveSewaAsrama(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when save Sewa Asrama", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when saveSewaAsrama", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when save Sewa Asrama", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when saveSewaAsrama", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-by-no-order/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> findByNoOrder(
|
||||
@RequestParam(value = "noOrder", required = false) String noOrder, HttpServletRequest request) {
|
||||
Map<String, Object> result = sewaAsramaService.findByNoOrder(noOrder);
|
||||
Boolean dataFound = new Boolean((boolean) result.get("dataFound"));
|
||||
if (dataFound) {
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
} else {
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,
|
||||
getMessage(MessageResource.LABEL_ERROR, request));
|
||||
}
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-status-kamar/", method = RequestMethod.GET)
|
||||
public ResponseEntity<Map<String, Object>> findStatusKamar(
|
||||
@RequestParam(value = "periodeAwal", required = true) String periodeAwal,
|
||||
@RequestParam(value = "periodeAkhir", required = true) String periodeAkhir,
|
||||
@RequestParam(value = "idKamar", required = true) Integer idKamar, HttpServletRequest request) {
|
||||
@RequestMapping(value = "/find-status-kamar/", method = GET)
|
||||
public ResponseEntity<Map<String, Object>> findStatusKamar(@RequestParam(value = "periodeAwal") String periodeAwal,
|
||||
@RequestParam(value = "periodeAkhir") String periodeAkhir, @RequestParam(value = "idKamar") Integer idKamar,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> listKamarVO = sewaAsramaService.findStatusKamar(periodeAwal, periodeAkhir, idKamar);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(listKamarVO, HttpStatus.OK, mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(listKamarVO, OK, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when Find Kamar Asrama", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when findStatusKamar", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when Find Kamar Asrama", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when findStatusKamar", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-kamar/", method = RequestMethod.GET)
|
||||
public ResponseEntity<Map<String, Object>> findKamar(
|
||||
@RequestParam(value = "namaRuangan", required = true) String namaRuangan, HttpServletRequest request) {
|
||||
@RequestMapping(value = "/find-kamar/", method = GET)
|
||||
public ResponseEntity<Map<String, Object>> findKamar(@RequestParam(value = "namaRuangan") String namaRuangan,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> listKamarVO = sewaAsramaService.findKamar(namaRuangan);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(listKamarVO, HttpStatus.OK, mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(listKamarVO, OK, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when Find Kamar Asrama", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when findKamar", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when Find Kamar Asrama", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when findKamar", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,119 +1,77 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.dto.SewaLahanDto;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SewaLahanService;
|
||||
import com.jasamedika.medifirst2000.vo.SewaLahanVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.dto.SewaLahanDto;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SewaLahanService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SewaLahanVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sewa-lahan")
|
||||
public class SewaLahanController extends LocaleController<SewaLahanVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SewaLahanController.class);
|
||||
|
||||
@Autowired
|
||||
private SewaLahanService sewaLahanService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SewaLahanController.class);
|
||||
|
||||
@RequestMapping(value = "/save-sewa-lahan/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@RequestMapping(value = "/save-sewa-lahan/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> saveSewaLahan(@Valid @RequestBody SewaLahanVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = sewaLahanService.saveSewaLahan(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when save Sewa Lahan", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when saveSewaLahan", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when save Sewa Lahan", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when saveSewaLahan", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-by-no-order/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> findByNoOrder(
|
||||
@RequestParam(value = "noOrder", required = false) String noOrder, HttpServletRequest request) {
|
||||
Map<String, Object> result = sewaLahanService.findByNoOrder(noOrder);
|
||||
Boolean dataFound = new Boolean((boolean) result.get("dataFound"));
|
||||
if (dataFound) {
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
} else {
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,
|
||||
getMessage(MessageResource.LABEL_ERROR, request));
|
||||
}
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-sewa-lahan/", method = RequestMethod.GET)
|
||||
public ResponseEntity<List<SewaLahanDto>> findProdukSewaLahan(HttpServletRequest request) {
|
||||
try {
|
||||
List<SewaLahanDto> listSewaLahaVO = sewaLahanService.findProdukSewaLahan();
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(listSewaLahaVO, HttpStatus.OK, mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(listSewaLahaVO, OK, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when Find Sewa Lahan", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when findProdukSewaLahan", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when Find Sewa Lahan", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when findProdukSewaLahan", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-status-lahan/", method = RequestMethod.GET)
|
||||
public ResponseEntity<Map<String, Object>> findStatusLahan(
|
||||
@RequestParam(value = "periodeAwal", required = true) String periodeAwal,
|
||||
@RequestParam(value = "periodeAkhir", required = true) String periodeAkhir,
|
||||
@RequestParam(value = "idProduk", required = true) Integer idProduk, HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> listLahanVO = sewaLahanService.findStatusLahan(periodeAwal, periodeAkhir, idProduk);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(listLahanVO, HttpStatus.OK, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when Find Status Lahan", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when Find Status Lahan", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,33 +1,34 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.entities.SignInOperation;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SignInOperationService;
|
||||
import com.jasamedika.medifirst2000.vo.SignInOperationVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SignInOperationService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SignInOperationVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
/******************
|
||||
* @author Shakato
|
||||
@ -35,96 +36,74 @@ import com.jasamedika.medifirst2000.vo.SignInOperationVO;
|
||||
@RestController
|
||||
@RequestMapping("/signin-operation")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SignInOperationController extends LocaleController<SignInOperationVO>
|
||||
{
|
||||
|
||||
public class SignInOperationController extends LocaleController<SignInOperationVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SignInOperationController.class);
|
||||
|
||||
@Autowired
|
||||
private SignInOperationService signInOperationService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SignInOperationController.class);
|
||||
|
||||
|
||||
@RequestMapping(value = "/save-signin-operation/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> saveSignInOperation(@Valid @RequestBody SignInOperationVO vo, HttpServletRequest request) {
|
||||
private SignInOperationService<SignInOperation> signInOperationService;
|
||||
|
||||
@RequestMapping(value = "/save-signin-operation/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> saveSignInOperation(@Valid @RequestBody SignInOperationVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result = signInOperationService.saveSignInOperationService(vo);
|
||||
Map<String, Object> result = signInOperationService.saveSignInOperationService(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
RestUtil.getJsonHttpStatus(HttpStatus.CREATED);
|
||||
return RestUtil.getJsonResponse("Status Sukses", HttpStatus.CREATED,mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse("Status Sukses", CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when save SignInOperation", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when saveSignInOperationService", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when update SignInOperation", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(
|
||||
value = "/get-sign-in-by-norec",
|
||||
method = RequestMethod.GET,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSingInByNoRec(
|
||||
@RequestParam(value = "noRec", required = true) String noRec, HttpServletRequest request){
|
||||
|
||||
try {
|
||||
Map<String,Object> result = this.signInOperationService.getSingInByNoRec(noRec);
|
||||
|
||||
if (null != result){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
|
||||
|
||||
} else{
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
|
||||
|
||||
}
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when getSingInByNoRec", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when getSingInByNoRec", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = "/get-sign-in-by-norec-antrian",
|
||||
method = RequestMethod.GET,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSignInByNoRecAntrian(
|
||||
@RequestParam(value = "noRec", required = true) String noRec, HttpServletRequest request){
|
||||
|
||||
try {
|
||||
Map<String,Object> result = this.signInOperationService.getSingInByNoRecAntrian(noRec);
|
||||
|
||||
if (null != result){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
|
||||
|
||||
} else{
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
|
||||
|
||||
}
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when getSignInByNoRecAntrian", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when getSignInByNoRecAntrian", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
|
||||
LOGGER.error("Got JpaSystemException {} when saveSignInOperationService", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/get-sign-in-by-norec", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSingInByNoRec(@RequestParam(value = "noRec") String noRec,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = this.signInOperationService.getSingInByNoRec(noRec);
|
||||
if (null != result) {
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, OK, mapHeaderMessage);
|
||||
} else {
|
||||
return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
|
||||
}
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got ServiceVOException {} when getSingInByNoRec", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got JpaSystemException {} when getSingInByNoRec", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/get-sign-in-by-norec-antrian", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSignInByNoRecAntrian(@RequestParam(value = "noRec") String noRec,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = this.signInOperationService.getSingInByNoRecAntrian(noRec);
|
||||
if (null != result) {
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, OK, mapHeaderMessage);
|
||||
} else {
|
||||
return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
|
||||
}
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got ServiceVOException {} when getSingInByNoRecAntrian", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got JpaSystemException {} when getSingInByNoRecAntrian", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,33 +1,33 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SignOutOperationService;
|
||||
import com.jasamedika.medifirst2000.vo.SignOutOperationVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SignOutOperationService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SignOutOperationVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
/******************
|
||||
* @author Shakato
|
||||
@ -35,93 +35,73 @@ import com.jasamedika.medifirst2000.vo.SignOutOperationVO;
|
||||
@RestController
|
||||
@RequestMapping("/signout-operation")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SignOutOperationController extends LocaleController<SignOutOperationVO>
|
||||
{
|
||||
|
||||
public class SignOutOperationController extends LocaleController<SignOutOperationVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SignOutOperationController.class);
|
||||
|
||||
@Autowired
|
||||
private SignOutOperationService signOutOperationService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SignOutOperationController.class);
|
||||
|
||||
|
||||
@RequestMapping(value = "/save-signout-operation", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> saveSignInOperation(@Valid @RequestBody SignOutOperationVO vo, HttpServletRequest request) {
|
||||
|
||||
@RequestMapping(value = "/save-signout-operation", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> saveSignInOperation(@Valid @RequestBody SignOutOperationVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result = signOutOperationService.saveSignOutOperationService(vo);
|
||||
Map<String, Object> result = signOutOperationService.saveSignOutOperationService(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
RestUtil.getJsonHttpStatus(HttpStatus.CREATED);
|
||||
return RestUtil.getJsonResponse("Status Sukses", HttpStatus.CREATED,mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse("Status Sukses", CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when save SignOutOperation1", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when saveSignOutOperationService", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when update SignOutOperation2", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when saveSignOutOperationService", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = "/get-sign-out-by-norec",
|
||||
method = RequestMethod.GET,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSingOutByNoRec(
|
||||
@RequestParam(value = "noRec", required = true) String noRec, HttpServletRequest request){
|
||||
|
||||
|
||||
@RequestMapping(value = "/get-sign-out-by-norec", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSingOutByNoRec(@RequestParam(value = "noRec") String noRec,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result = this.signOutOperationService.getSignOutByNoRec(noRec);
|
||||
|
||||
if (null != result){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
|
||||
|
||||
} else{
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
|
||||
|
||||
Map<String, Object> result = this.signOutOperationService.getSignOutByNoRec(noRec);
|
||||
if (null != result) {
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, OK, mapHeaderMessage);
|
||||
} else {
|
||||
return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
|
||||
}
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when getSingOutByNoRec", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
|
||||
LOGGER.error("Got ServiceVOException {} when getSignOutByNoRec", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when getSingOutByNoRec", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
|
||||
LOGGER.error("Got JpaSystemException {} when getSignOutByNoRec", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(
|
||||
value = "/get-sign-out-by-norec-antrian",
|
||||
method = RequestMethod.GET,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSingOutByNoRecAntrian(
|
||||
@RequestParam(value = "noRec", required = true) String noRec, HttpServletRequest request){
|
||||
|
||||
|
||||
@RequestMapping(value = "/get-sign-out-by-norec-antrian", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> getSingOutByNoRecAntrian(@RequestParam(value = "noRec") String noRec,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result = this.signOutOperationService.getSignOutByNoRecAntrian(noRec);
|
||||
|
||||
if (null != result){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
|
||||
|
||||
} else{
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.NOT_FOUND,mapHeaderMessage);
|
||||
|
||||
Map<String, Object> result = this.signOutOperationService.getSignOutByNoRecAntrian(noRec);
|
||||
if (null != result) {
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, OK, mapHeaderMessage);
|
||||
} else {
|
||||
return getJsonResponse(null, NOT_FOUND, mapHeaderMessage);
|
||||
}
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when getSingOutByNoRecAntrian", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
|
||||
LOGGER.error("Got ServiceVOException {} when getSignOutByNoRecAntrian", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when getSingOutByNoRecAntrian", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
|
||||
LOGGER.error("Got JpaSystemException {} when getSignOutByNoRecAntrian", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,149 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.IBaseRestController;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SiklusGiziService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SiklusGiziVO;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value="/siklus-gizi")
|
||||
public class SiklusGiziController extends LocaleController<SiklusGiziVO>
|
||||
implements IBaseRestController<SiklusGiziVO>{
|
||||
|
||||
@Autowired
|
||||
private SiklusGiziService siklusService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
.getLogger(IndikatorRensarController.class);
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Collection<SiklusGiziVO>> getAllVOWithQueryString(HttpServletRequest request, Integer page,
|
||||
Integer limit, String sort, String dir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<SiklusGiziVO> getVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> addVO(SiklusGiziVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> editVO(SiklusGiziVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> deleteVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<List<SiklusGiziVO>> getAllVO() {
|
||||
return null;
|
||||
}
|
||||
|
||||
//Created by Pratama
|
||||
//Error karna column siklusKe yang ada di database masih varchar sedangkan di java integer
|
||||
@RequestMapping(value="/find-all/", method= RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
// public ResponseEntity<Collection<SiklusGizi>> findAll(
|
||||
// @RequestParam(value = "page", required = false, defaultValue = "0") Integer page,
|
||||
// @RequestParam(value = "take", required = false, defaultValue = "100") Integer take,
|
||||
// @RequestParam(value = "sort", required = false, defaultValue = "id") String sort,
|
||||
// @RequestParam(value = "dir", required = false, defaultValue = "asc") String dir,
|
||||
// @Spec(path = "siklusKe", params = "siklusKe", spec = Equal.class) Specification<SiklusGizi> siklusKe,
|
||||
// @Spec(path = "jenisWaktu.id", params = "jenisWaktuId", spec = Equal.class) Specification<SiklusGizi> jenisWaktu,
|
||||
// @Spec(path = "kelas.id", params = "kelasId", spec = Equal.class) Specification<SiklusGizi> kelas)
|
||||
// {
|
||||
// Map<String, Object> result = new HashMap<String, Object>();
|
||||
// Specification<SiklusGizi> spec = Specifications.where(siklusKe).and(jenisWaktu).and(kelas);
|
||||
// result = siklusService.findAll(page, take, sort,dir, spec);
|
||||
// return constructListPageResult(result);
|
||||
// }
|
||||
|
||||
public ResponseEntity<Map<String,Object>> findAll(
|
||||
@RequestParam(value = "jenisWaktuId", required=false) Integer jenisWaktuId,
|
||||
@RequestParam(value = "siklusKe", required=false) Integer siklusKe,
|
||||
@RequestParam(value = "kelasId", required=false) Integer kelasId,
|
||||
@RequestParam(value = "jenisDietId", required=false) Integer jenisDietId,
|
||||
@RequestParam(value = "kategoryProdukId", required=false) Integer kategoryProdukId,
|
||||
@RequestParam(value = "bentukProdukId", required=false) Integer bentukProdukId,
|
||||
HttpServletRequest request
|
||||
){
|
||||
try{
|
||||
Map<String, Object> result = siklusService.findAll(jenisWaktuId, siklusKe, kelasId, jenisDietId, kategoryProdukId, bentukProdukId);
|
||||
if(null!= result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when get Siklus Gizi", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when get Siklus Gizi", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
// Created by Pratama
|
||||
// Belum di tes
|
||||
@RequestMapping(value="/save/", method= RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> save(@Valid @RequestBody List<SiklusGiziVO> vos,HttpServletRequest request){
|
||||
try{
|
||||
Map<String, Object> result = siklusService.save(vos);
|
||||
if(null!= result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add/update Siklus Gizi", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add/update Siklus Gizi", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,86 +1,23 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.*;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.service.SlowFastMovingService;
|
||||
import com.jasamedika.medifirst2000.vo.StrukPelayananDetailVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.entities.DetailSpekAnggaran;
|
||||
import com.jasamedika.medifirst2000.entities.StrukOrder;
|
||||
import com.jasamedika.medifirst2000.entities.StrukPelayananDetail;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.security.model.AppPermission;
|
||||
import com.jasamedika.medifirst2000.service.PemusnahanBarangService;
|
||||
import com.jasamedika.medifirst2000.service.SlowFastMovingService;
|
||||
import com.jasamedika.medifirst2000.service.StrukOrderService;
|
||||
import com.jasamedika.medifirst2000.service.StrukPelayananDetailService;
|
||||
import com.jasamedika.medifirst2000.service.StrukPelayananService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.DetailAnggaranVO;
|
||||
import com.jasamedika.medifirst2000.vo.DistribusiBarangInvestasiVO;
|
||||
import com.jasamedika.medifirst2000.vo.PenerimaanBarangDetailVO;
|
||||
import com.jasamedika.medifirst2000.vo.PenerimaanBarangVO;
|
||||
import com.jasamedika.medifirst2000.vo.RequestBarangDariRuanganVO;
|
||||
import com.jasamedika.medifirst2000.vo.StrukHistoriVO;
|
||||
import com.jasamedika.medifirst2000.vo.StrukKirimVO;
|
||||
import com.jasamedika.medifirst2000.vo.StrukOrderVO;
|
||||
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.DateBetween;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.Equal;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.Like;
|
||||
import net.kaczmarzyk.spring.data.jpa.domain.Null;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.And;
|
||||
import net.kaczmarzyk.spring.data.jpa.web.annotation.Spec;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/slow-fast-moving")
|
||||
public class SlowFastMovingController extends LocaleController{
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SlowFastMovingController.class);
|
||||
|
||||
public class SlowFastMovingController extends LocaleController<StrukPelayananDetailVO> {
|
||||
|
||||
@Autowired
|
||||
private SlowFastMovingService slowFastMovingService;
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping(value = "/slow-moving")
|
||||
@ResponseBody
|
||||
public Map<String, Object> slowMoving(
|
||||
@RequestParam(value = "kelompokProdukId", required = false) Integer kelompokProdukId,
|
||||
@RequestParam(value = "jenisProdukId", required = false) Integer jenisProdukId,
|
||||
@RequestParam(value = "produkId", required = false) Integer produkId,
|
||||
@RequestParam(value = "dateStart", required = false) String dateStart,
|
||||
@RequestParam(value = "dateEnd", required = false) String dateEnd) {
|
||||
|
||||
Map<String, Object> resultPageMap = slowFastMovingService.slowMoving(dateStart,dateEnd, kelompokProdukId, jenisProdukId, produkId);
|
||||
|
||||
return resultPageMap;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping(value = "/fast-moving")
|
||||
@ResponseBody
|
||||
public Map<String, Object> fastMoving(
|
||||
@ -89,10 +26,7 @@ public class SlowFastMovingController extends LocaleController{
|
||||
@RequestParam(value = "produkId", required = false) Integer produkId,
|
||||
@RequestParam(value = "dateStart", required = false) String dateStart,
|
||||
@RequestParam(value = "dateEnd", required = false) String dateEnd) {
|
||||
|
||||
Map<String, Object> resultPageMap = slowFastMovingService.fastMoving(dateStart,dateEnd, kelompokProdukId, jenisProdukId, produkId);
|
||||
|
||||
return resultPageMap;
|
||||
return slowFastMovingService.fastMoving(dateStart,dateEnd, kelompokProdukId, jenisProdukId, produkId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,77 +1,37 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.entities.*;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.*;
|
||||
import com.jasamedika.medifirst2000.vo.SoapVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.IBaseRestController;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.entities.Anamnesis;
|
||||
import com.jasamedika.medifirst2000.entities.DetailDiagnosaPasien;
|
||||
import com.jasamedika.medifirst2000.entities.DetailDiagnosaTindakanPasien;
|
||||
import com.jasamedika.medifirst2000.entities.DiagnosaPasien;
|
||||
import com.jasamedika.medifirst2000.entities.DiagnosaTindakanPasien;
|
||||
import com.jasamedika.medifirst2000.entities.LembarKonsultasi;
|
||||
import com.jasamedika.medifirst2000.entities.PapAnamesis;
|
||||
import com.jasamedika.medifirst2000.entities.PapEliminasi;
|
||||
import com.jasamedika.medifirst2000.entities.PapGastrointestinal;
|
||||
import com.jasamedika.medifirst2000.entities.PapGenatalia;
|
||||
import com.jasamedika.medifirst2000.entities.PapGigiMulut;
|
||||
import com.jasamedika.medifirst2000.entities.PapGinekologi;
|
||||
import com.jasamedika.medifirst2000.entities.PapIntegumen;
|
||||
import com.jasamedika.medifirst2000.entities.PapKeluhanUtama;
|
||||
import com.jasamedika.medifirst2000.entities.PapMuskuloskeletal;
|
||||
import com.jasamedika.medifirst2000.entities.PapNeurologi;
|
||||
import com.jasamedika.medifirst2000.entities.PapPernapasan;
|
||||
import com.jasamedika.medifirst2000.entities.PapRehabilitasi;
|
||||
import com.jasamedika.medifirst2000.entities.PapSirkulasi;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.AnamnesisService;
|
||||
import com.jasamedika.medifirst2000.service.DiagnosaPasienService;
|
||||
import com.jasamedika.medifirst2000.service.DiagnosaTindakanPasienService;
|
||||
import com.jasamedika.medifirst2000.service.LembarKonsultasiService;
|
||||
import com.jasamedika.medifirst2000.service.PapAnamesisService;
|
||||
import com.jasamedika.medifirst2000.service.PapBedahService;
|
||||
import com.jasamedika.medifirst2000.service.PapEliminasiService;
|
||||
import com.jasamedika.medifirst2000.service.PapGastrointestinalService;
|
||||
import com.jasamedika.medifirst2000.service.PapGenataliaService;
|
||||
import com.jasamedika.medifirst2000.service.PapGigiMulutService;
|
||||
import com.jasamedika.medifirst2000.service.PapGinekologiService;
|
||||
import com.jasamedika.medifirst2000.service.PapIntegumenService;
|
||||
import com.jasamedika.medifirst2000.service.PapKeluhanUtamaService;
|
||||
import com.jasamedika.medifirst2000.service.PapMataService;
|
||||
import com.jasamedika.medifirst2000.service.PapMuskuloskeletalService;
|
||||
import com.jasamedika.medifirst2000.service.PapNeurologiService;
|
||||
import com.jasamedika.medifirst2000.service.PapPernapasanService;
|
||||
import com.jasamedika.medifirst2000.service.PapRehabilitasiService;
|
||||
import com.jasamedika.medifirst2000.service.PapSirkulasiService;
|
||||
import com.jasamedika.medifirst2000.service.PapThtService;
|
||||
import com.jasamedika.medifirst2000.service.SoapService;
|
||||
import com.jasamedika.medifirst2000.util.DateUtil;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SoapVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_ERROR;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.DateUtil.toDate;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
/**
|
||||
* Controller class for Pengakjian Awal Gawat Darurat Business
|
||||
@ -80,548 +40,328 @@ import com.jasamedika.medifirst2000.vo.SoapVO;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/soap")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SoapController extends LocaleController<SoapVO> implements
|
||||
IBaseRestController<SoapVO> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SoapController.class);
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SoapController extends LocaleController<SoapVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SoapController.class);
|
||||
|
||||
@Autowired
|
||||
private SoapService soapService;
|
||||
private SoapService<Soap> soapService;
|
||||
|
||||
@Autowired
|
||||
private PapKeluhanUtamaService papkeluhanUtamaService;
|
||||
private PapKeluhanUtamaService<PapKeluhanUtama> papkeluhanUtamaService;
|
||||
|
||||
@Autowired
|
||||
private AnamnesisService anamansisService;
|
||||
@Autowired
|
||||
private PapAnamesisService papAnamesisService;
|
||||
|
||||
@Autowired
|
||||
private PapPernapasanService papPernapasanService;
|
||||
private PapAnamesisService<PapAnamesis> papAnamesisService;
|
||||
|
||||
@Autowired
|
||||
private PapSirkulasiService papSirkulasiService;
|
||||
private PapPernapasanService<PapPernapasan> papPernapasanService;
|
||||
|
||||
@Autowired
|
||||
private PapNeurologiService papNeurologiService;
|
||||
private PapSirkulasiService<PapSirkulasi> papSirkulasiService;
|
||||
|
||||
@Autowired
|
||||
private PapGastrointestinalService papGastrointestinalService;
|
||||
private PapNeurologiService<PapNeurologi> papNeurologiService;
|
||||
|
||||
@Autowired
|
||||
private PapEliminasiService papEliminasiService;
|
||||
private PapGastrointestinalService<PapGastrointestinal> papGastrointestinalService;
|
||||
|
||||
@Autowired
|
||||
private PapIntegumenService papIntegumenService;
|
||||
private PapEliminasiService<PapEliminasi> papEliminasiService;
|
||||
|
||||
@Autowired
|
||||
private PapMuskuloskeletalService papMuskuloskeletalService;
|
||||
private PapIntegumenService<PapIntegumen> papIntegumenService;
|
||||
|
||||
@Autowired
|
||||
private PapGenataliaService papGenataliaService;
|
||||
|
||||
private PapMuskuloskeletalService<PapMuskuloskeletal> papMuskuloskeletalService;
|
||||
|
||||
@Autowired
|
||||
private PapGinekologiService papGinekologiService;
|
||||
private PapGenataliaService<PapGenatalia> papGenataliaService;
|
||||
|
||||
@Autowired
|
||||
private PapRehabilitasiService papRehabilitasiService;
|
||||
private PapGinekologiService<PapGinekologi> papGinekologiService;
|
||||
|
||||
@Autowired
|
||||
private PapBedahService papBedahService;
|
||||
private PapRehabilitasiService<PapRehabilitasi> papRehabilitasiService;
|
||||
|
||||
@Autowired
|
||||
private PapGigiMulutService papGigiMulutService;
|
||||
private PapBedahService<PapBedah> papBedahService;
|
||||
|
||||
@Autowired
|
||||
private PapMataService papMataService;
|
||||
private PapGigiMulutService<PapGigiMulut> papGigiMulutService;
|
||||
|
||||
@Autowired
|
||||
private PapThtService papThtService;
|
||||
private PapMataService<PapMata> papMataService;
|
||||
|
||||
@Autowired
|
||||
private DiagnosaPasienService diagnosaPasienService;
|
||||
|
||||
@Autowired
|
||||
private DiagnosaTindakanPasienService diagnosaTindakanPasienService;
|
||||
|
||||
@Autowired
|
||||
private LembarKonsultasiService lembarKonsultasiService;
|
||||
private LembarKonsultasiService<LembarKonsultasi> lembarKonsultasiService;
|
||||
|
||||
@RequestMapping(value = "/save-soap", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> save(@Valid @RequestBody SoapVO vo,HttpServletRequest request) {
|
||||
@RequestMapping(value = "/save-soap", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> save(@Valid @RequestBody SoapVO vo, HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result = soapService.addSoap(vo);
|
||||
|
||||
if (null != result){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
Map<String, Object> result = soapService.addSoap(vo);
|
||||
if (null != result) {
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
result.put("message", "Berhasil");
|
||||
}else{
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
result.put("message", "Gagal");
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} else {
|
||||
mapHeaderMessage.put(LABEL_ERROR, getMessage(MessageResource.LABEL_ERROR, request));
|
||||
return getJsonHttpStatus(ACCEPTED, mapHeaderMessage);
|
||||
}
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add Pasien", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when addSoap", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add Pasien", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when addSoap", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/edit-soap", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> edit(@Valid @RequestBody SoapVO vo,HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result = soapService.updateSoap(vo);
|
||||
|
||||
if (null != result){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
result.put("message", "Berhasil");
|
||||
}else{
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
result.put("message", "Gagal");
|
||||
}
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add Pasien", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add Pasien", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
@RequestMapping(value = "/select-for-soap/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> selectForSOAP(
|
||||
@RequestParam(value = "noCm", required = false) String noCm,
|
||||
@RequestParam(value = "tglInput", required = false) String tglInput, HttpServletRequest request) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
String s = selectSInSOAP(noCm, tglInput);
|
||||
String o = selectOInSOAP(noCm, tglInput);
|
||||
String a = selectAInSOAP(noCm, tglInput);
|
||||
String p = selectPInSOAP(noCm, tglInput);
|
||||
boolean dataFoundS;
|
||||
boolean dataFoundO;
|
||||
boolean dataFoundA;
|
||||
boolean dataFoundP;
|
||||
if (s.equals("dataFound : false")) {
|
||||
dataFoundS = false;
|
||||
s = "";
|
||||
} else {
|
||||
dataFoundS = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-by-noCm-and-tglInput/{noCm}/{tglInput}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> findByNoCm(@PathVariable("noCm") String noCm,@PathVariable("tglInput") String tglInput,HttpServletRequest request) {
|
||||
Map<String,Object> result = soapService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
||||
if(dataFound){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
}else{
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
if (o.equals("dataFound : false")) {
|
||||
dataFoundO = false;
|
||||
o = "";
|
||||
} else {
|
||||
dataFoundO = true;
|
||||
}
|
||||
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/select-for-soap/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> selectForSOAP(@RequestParam(value = "noCm", required = false) String noCm,
|
||||
@RequestParam(value = "tglInput", required = false) String tglInput,HttpServletRequest request) {
|
||||
Map<String,Object> result = new HashMap<String,Object>();
|
||||
String s=selectSInSOAP(noCm,tglInput);
|
||||
String o=selectOInSOAP(noCm,tglInput);
|
||||
String a=selectAInSOAP(noCm,tglInput);
|
||||
String p=selectPInSOAP(noCm,tglInput);
|
||||
Boolean dataFoundS;
|
||||
Boolean dataFoundO;
|
||||
Boolean dataFoundA;
|
||||
Boolean dataFoundP;
|
||||
if(s.equals("dataFound : false")){
|
||||
dataFoundS=false;
|
||||
s="";
|
||||
}else{
|
||||
dataFoundS=true;
|
||||
if (a.equals("dataFound : false")) {
|
||||
dataFoundA = false;
|
||||
a = "";
|
||||
} else {
|
||||
dataFoundA = true;
|
||||
}
|
||||
if(o.equals("dataFound : false")){
|
||||
dataFoundO=false;
|
||||
o="";
|
||||
}else{
|
||||
dataFoundO=true;
|
||||
}
|
||||
if(a.equals("dataFound : false")){
|
||||
dataFoundA=false;
|
||||
a="";
|
||||
}else{
|
||||
dataFoundA=true;
|
||||
}
|
||||
if(p.equals("dataFound : false")){
|
||||
dataFoundP=false;
|
||||
p="";
|
||||
}else{
|
||||
dataFoundP=true;
|
||||
if (p.equals("dataFound : false")) {
|
||||
dataFoundP = false;
|
||||
p = "";
|
||||
} else {
|
||||
dataFoundP = true;
|
||||
}
|
||||
result.put("s", s);
|
||||
result.put("o", o);
|
||||
result.put("a", a);
|
||||
result.put("p", p);
|
||||
Boolean dataFound=dataFoundS || dataFoundO || dataFoundA || dataFoundP;
|
||||
if(dataFound){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
}else{
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
boolean dataFound = dataFoundS || dataFoundO || dataFoundA || dataFoundP;
|
||||
if (dataFound) {
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
} else {
|
||||
mapHeaderMessage.put(LABEL_ERROR, getMessage(MessageResource.LABEL_ERROR, request));
|
||||
}
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK,mapHeaderMessage);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/select-for-s/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> selectForSInSOAP(@RequestParam(value = "noCm", required = false) String noCm,
|
||||
@RequestParam(value = "tglInput", required = false) String tglInput,HttpServletRequest request) {
|
||||
Map<String,Object> resultUmum=anamansisService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> resultKhusus=papAnamesisService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
StringBuffer s=new StringBuffer();
|
||||
|
||||
Boolean dataFoundUmum=new Boolean((boolean) resultUmum.get("dataFound"));
|
||||
Boolean dataFoundKhusus=new Boolean((boolean) resultKhusus.get("dataFound"));
|
||||
Boolean dataFound=dataFoundUmum || dataFoundKhusus;
|
||||
if(dataFound){
|
||||
if(dataFoundUmum){
|
||||
s.append("Umum [ ");
|
||||
s.append("Anamnesis (Suster) : "+((Anamnesis)resultUmum.get("anamansis")).getAnamnesisSuster()+", ");
|
||||
s.append("Anamnesis (Dokter) : "+((Anamnesis)resultUmum.get("anamansis")).getAnamnesisDokter()+".");
|
||||
s.append(" ] ");
|
||||
}
|
||||
if(dataFoundKhusus){
|
||||
s.append("Khusus [ ");
|
||||
s.append("Anamnesis : "+((PapAnamesis)resultKhusus.get("papAnamesis")).getKeluhan()+". ");
|
||||
s.append(" ] ");
|
||||
}
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
}
|
||||
return RestUtil.getJsonResponse(s.toString(), HttpStatus.OK,mapHeaderMessage);
|
||||
return getJsonResponse(result, OK, mapHeaderMessage);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/select-for-o/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> selectForOInSOAP(@RequestParam(value = "noCm", required = false) String noCm,
|
||||
@RequestParam(value = "tglInput", required = false) String tglInput,HttpServletRequest request) {
|
||||
Map<String,Object> result1=papPernapasanService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result2=papSirkulasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result3=papNeurologiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result4=papGastrointestinalService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result5=papEliminasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result6=papIntegumenService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result7=papMuskuloskeletalService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result8=papGenataliaService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
|
||||
Map<String,Object> result9=papGinekologiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result10=papRehabilitasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result11=papBedahService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result12=papGigiMulutService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result13=papMataService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result14=papThtService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
private String selectSInSOAP(String noCm, String tglInput) {
|
||||
Map<String, Object> keluhanUtama = papkeluhanUtamaService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> resultUmum = anamansisService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> resultKhusus = papAnamesisService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
StringBuilder s = new StringBuilder();
|
||||
Boolean dataKeluhanUtama = (boolean) keluhanUtama.get("dataFound");
|
||||
Boolean dataFoundUmum = (boolean) resultUmum.get("dataFound");
|
||||
Boolean dataFoundKhusus = (boolean) resultKhusus.get("dataFound");
|
||||
boolean dataFound = dataFoundUmum || dataFoundKhusus || dataKeluhanUtama;
|
||||
if (dataFound) {
|
||||
if (dataKeluhanUtama)
|
||||
s.append("Keluhan Utama : ")
|
||||
.append(((PapKeluhanUtama) keluhanUtama.get("papKeluhanUtama")).getKeluhanUtama()).append(", ");
|
||||
if (dataFoundUmum) {
|
||||
s.append("Umum [ ");
|
||||
s.append("Anamnesis (Suster) : ").append(((Anamnesis) resultUmum.get("anamansis")).getAnamnesisSuster())
|
||||
.append(", ");
|
||||
s.append("Anamnesis (Dokter) : ").append(((Anamnesis) resultUmum.get("anamansis")).getAnamnesisDokter())
|
||||
.append(".");
|
||||
s.append(" ] ");
|
||||
}
|
||||
if (dataFoundKhusus) {
|
||||
s.append("Khusus [ ");
|
||||
s.append("Anamnesis : ").append(((PapAnamesis) resultKhusus.get("papAnamesis")).getKeluhan())
|
||||
.append(". ");
|
||||
s.append(" ] ");
|
||||
}
|
||||
} else {
|
||||
s.append("dataFound : ").append(false);
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
Boolean dataFound1=new Boolean((boolean) result1.get("dataFound"));
|
||||
Boolean dataFound2=new Boolean((boolean) result2.get("dataFound"));
|
||||
Boolean dataFound3=new Boolean((boolean) result3.get("dataFound"));
|
||||
Boolean dataFound4=new Boolean((boolean) result4.get("dataFound"));
|
||||
Boolean dataFound5=new Boolean((boolean) result5.get("dataFound"));
|
||||
Boolean dataFound6=new Boolean((boolean) result6.get("dataFound"));
|
||||
Boolean dataFound7=new Boolean((boolean) result7.get("dataFound"));
|
||||
Boolean dataFound8=new Boolean((boolean) result8.get("dataFound"));
|
||||
|
||||
Boolean dataFound9=new Boolean((boolean) result9.get("dataFound"));
|
||||
Boolean dataFound10=new Boolean((boolean) result10.get("dataFound"));
|
||||
Boolean dataFound11=new Boolean((boolean) result11.get("dataFound"));
|
||||
Boolean dataFound12=new Boolean((boolean) result12.get("dataFound"));
|
||||
Boolean dataFound13=new Boolean((boolean) result13.get("dataFound"));
|
||||
|
||||
Boolean dataFoundUmum = dataFound1 || dataFound2 || dataFound3 || dataFound4
|
||||
|| dataFound5 || dataFound6 || dataFound7 || dataFound8;
|
||||
private String selectOInSOAP(String noCm, String tglInput) {
|
||||
Map<String, Object> result1 = papPernapasanService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result2 = papSirkulasiService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result3 = papNeurologiService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result4 = papGastrointestinalService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result5 = papEliminasiService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result6 = papIntegumenService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result7 = papMuskuloskeletalService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result8 = papGenataliaService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result9 = papGinekologiService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result10 = papRehabilitasiService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result11 = papBedahService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result12 = papGigiMulutService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result13 = papMataService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Boolean dataFound1 = (boolean) result1.get("dataFound");
|
||||
Boolean dataFound2 = (boolean) result2.get("dataFound");
|
||||
Boolean dataFound3 = (boolean) result3.get("dataFound");
|
||||
Boolean dataFound4 = (boolean) result4.get("dataFound");
|
||||
Boolean dataFound5 = (boolean) result5.get("dataFound");
|
||||
Boolean dataFound6 = (boolean) result6.get("dataFound");
|
||||
Boolean dataFound7 = (boolean) result7.get("dataFound");
|
||||
Boolean dataFound8 = (boolean) result8.get("dataFound");
|
||||
Boolean dataFound9 = (boolean) result9.get("dataFound");
|
||||
Boolean dataFound10 = (boolean) result10.get("dataFound");
|
||||
Boolean dataFound11 = (boolean) result11.get("dataFound");
|
||||
Boolean dataFound12 = (boolean) result12.get("dataFound");
|
||||
Boolean dataFound13 = (boolean) result13.get("dataFound");
|
||||
Boolean dataFoundUmum = dataFound1 || dataFound2 || dataFound3 || dataFound4 || dataFound5 || dataFound6
|
||||
|| dataFound7 || dataFound8;
|
||||
Boolean dataFoundKhusus = dataFound9 || dataFound10 || dataFound11 || dataFound12 || dataFound13;
|
||||
Boolean dataFound = dataFoundUmum || dataFoundKhusus;
|
||||
StringBuffer s=new StringBuffer();
|
||||
if(dataFound){
|
||||
if(dataFoundUmum){
|
||||
s.append("Umum [ ");
|
||||
s.append("Pernapasan : "+(((PapPernapasan) result1.get("papPernapasan")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
s.append("Sirkulasi : "+(((PapSirkulasi) result2.get("papSirkulasi")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
s.append("Neurologi : "+(((PapNeurologi) result3.get("papNeurologi")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
s.append("Gastrointestinal : "+(((PapGastrointestinal) result4.get("papGastrointestinal")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
s.append("Eliminasi : "+(((PapEliminasi) result5.get("papEliminasi")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
s.append("Integumen : "+(((PapIntegumen) result6.get("papIntegumen")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
s.append("Muskuloskeletal : "+(((PapMuskuloskeletal) result7.get("papMuskuloskeletal")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
s.append("Genatalia : "+(((PapGenatalia) result8.get("papGenatalia")).getIsNormal()?"Normal":"Tidak Normal")+".");
|
||||
s.append(" ] ");
|
||||
boolean dataFound = dataFoundUmum || dataFoundKhusus;
|
||||
StringBuilder s = new StringBuilder();
|
||||
if (dataFound) {
|
||||
if (dataFoundUmum) {
|
||||
s.append("Umum [ ");
|
||||
if (dataFound1)
|
||||
s.append("Pernapasan : ").append(
|
||||
((PapPernapasan) result1.get("papPernapasan")).getIsNormal() ? "Normal" : "Tidak Normal")
|
||||
.append(", ");
|
||||
if (dataFound2)
|
||||
s.append("Sirkulasi : ").append(
|
||||
((PapSirkulasi) result2.get("papSirkulasi")).getIsNormal() ? "Normal" : "Tidak Normal")
|
||||
.append(", ");
|
||||
if (dataFound3)
|
||||
s.append("Neurologi : ").append(
|
||||
((PapNeurologi) result3.get("papNeurologi")).getIsNormal() ? "Normal" : "Tidak Normal")
|
||||
.append(", ");
|
||||
if (dataFound4)
|
||||
s.append("Gastrointestinal : ")
|
||||
.append(((PapGastrointestinal) result4.get("papGastrointestinal")).getIsNormal() ? "Normal"
|
||||
: "Tidak Normal")
|
||||
.append(", ");
|
||||
if (dataFound5)
|
||||
s.append("Eliminasi : ").append(
|
||||
((PapEliminasi) result5.get("papEliminasi")).getIsNormal() ? "Normal" : "Tidak Normal")
|
||||
.append(", ");
|
||||
if (dataFound6)
|
||||
s.append("Integumen : ").append(
|
||||
((PapIntegumen) result6.get("papIntegumen")).getIsNormal() ? "Normal" : "Tidak Normal")
|
||||
.append(", ");
|
||||
if (dataFound7)
|
||||
s.append("Muskuloskeletal : ")
|
||||
.append(((PapMuskuloskeletal) result7.get("papMuskuloskeletal")).getIsNormal() ? "Normal"
|
||||
: "Tidak Normal")
|
||||
.append(", ");
|
||||
if (dataFound8)
|
||||
s.append("Genatalia : ").append(
|
||||
((PapGenatalia) result8.get("papGenatalia")).getIsNormal() ? "Normal" : "Tidak Normal")
|
||||
.append(".");
|
||||
s.append(" ] ");
|
||||
}
|
||||
if(dataFoundKhusus){
|
||||
s.append("Khusus [ ");
|
||||
s.append("Ginekologi : "+(((PapGinekologi) result8.get("papGinekologi")).getPengobatan())+", ");
|
||||
s.append("Rehabilitasi : "+(((PapRehabilitasi) result8.get("papRehabilitasi")).getMasalahMedisDanRehabilitasi())+", ");
|
||||
s.append("Bedah : [ ");
|
||||
s.append(" ]");
|
||||
s.append("Gigi Mulut : "+(((PapGigiMulut) result8.get("papGigiMulut")).getPapKeadaanGigi().getName())+", ");
|
||||
//s.append("Mata : "+(((PapMata) result8.get("papMata")).getStreak())+", ");
|
||||
s.append("Obstetri : "+""+", "); //80%
|
||||
s.append("Gizi : "+""+", "); //back end belum (arya)
|
||||
s.append("Tumbuh Kembang Anak : "+""+", "); //back end belum
|
||||
s.append("Psikologi : "+""+", "); //ga ada tglinput (belum integrasi)
|
||||
s.append("THT : "+""+", ");
|
||||
s.append("CLP : "+""+", "); //form belum ada
|
||||
s.append("Bayi Tabung : "+""+", "); //form belum ada (form di adri , backend di susi,tinggal integrasi)
|
||||
s.append("Neonatus : "+""+", "); //form belum ada
|
||||
s.append(" ] ");
|
||||
if (dataFoundKhusus) {
|
||||
s.append("Khusus [ ");
|
||||
s.append("Ginekologi : ").append(((PapGinekologi) result9.get("papGinekologi")).getPengobatan())
|
||||
.append(", ");
|
||||
s.append("Rehabilitasi : ")
|
||||
.append(((PapRehabilitasi) result10.get("papRehabilitasi")).getMasalahMedisDanRehabilitasi())
|
||||
.append(", ");
|
||||
s.append("Bedah : [ ");
|
||||
s.append(" ]");
|
||||
s.append("Gigi Mulut : ")
|
||||
.append(((PapGigiMulut) result12.get("papGigiMulut")).getPapKeadaanGigi().getName())
|
||||
.append(", ");
|
||||
s.append("Obstetri : " + ", ");
|
||||
s.append("Gizi : " + ", ");
|
||||
s.append("Tumbuh Kembang Anak : " + ", ");
|
||||
s.append("Psikologi : " + ", ");
|
||||
s.append("THT : " + ", ");
|
||||
s.append("CLP : " + ", ");
|
||||
s.append("Bayi Tabung : " + ", ");
|
||||
s.append("Neonatus : " + ", ");
|
||||
s.append(" ] ");
|
||||
}
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
} else {
|
||||
s.append("dataFound : ").append(false);
|
||||
}
|
||||
return RestUtil.getJsonResponse(s.toString(), HttpStatus.OK,mapHeaderMessage);
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/select-for-a/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> selectForAInSOAP(@RequestParam(value = "noCm", required = false) String noCm,
|
||||
@RequestParam(value = "tglInput", required = false) String tglInput,HttpServletRequest request) {
|
||||
Map<String,Object> result=diagnosaPasienService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
StringBuffer s=new StringBuffer();
|
||||
|
||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
||||
if(dataFound){
|
||||
s.append("Rencana Tindakan : [ "); // backend : DiagnosaPasien
|
||||
for(DetailDiagnosaPasien detail:((DiagnosaPasien) result.get("diagnosaPasien")).getDiagnosis()){
|
||||
s.append(detail.getDiagnosa().getNamaDiagnosa()+", ");
|
||||
}
|
||||
s.append(" ] ");
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
}
|
||||
return RestUtil.getJsonResponse(s.toString(), HttpStatus.OK,mapHeaderMessage);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/select-for-p/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> selectForPInSOAP(@RequestParam(value = "noCm", required = false) String noCm,
|
||||
@RequestParam(value = "tglInput", required = false) String tglInput,HttpServletRequest request) {
|
||||
Map<String,Object> result1=lembarKonsultasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result2=diagnosaTindakanPasienService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
StringBuffer s=new StringBuffer();
|
||||
Boolean dataFound1=new Boolean((boolean) result1.get("dataFound"));
|
||||
Boolean dataFound2=new Boolean((boolean) result2.get("dataFound"));
|
||||
Boolean dataFound=dataFound1 || dataFound2;
|
||||
if(dataFound){
|
||||
s.append("Rencana Konsultasi : "+(((LembarKonsultasi) result1.get("lembarKonsultasi")).getSaran())+", ");
|
||||
private String selectAInSOAP(String noCm, String tglInput) {
|
||||
Map<String, Object> result = diagnosaPasienService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
StringBuilder s = new StringBuilder();
|
||||
boolean dataFound = (boolean) result.get("dataFound");
|
||||
if (dataFound) {
|
||||
s.append("Rencana Tindakan : [ ");
|
||||
for(DetailDiagnosaTindakanPasien detail:((DiagnosaTindakanPasien) result2.get("diagnosaTindakanPasien")).getDiagnosisTindakan()){
|
||||
s.append(detail.getDiagnosaTindakan().getNamaDiagnosaTindakan()+", ");
|
||||
for (DetailDiagnosaPasien detail : ((DiagnosaPasien) result.get("diagnosaPasien")).getDiagnosis()) {
|
||||
s.append(detail.getDiagnosa().getNamaDiagnosa()).append(", ");
|
||||
}
|
||||
s.append(" ] ");
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
}
|
||||
|
||||
/*
|
||||
StringBuffer s=new StringBuffer();
|
||||
s.append("Rencana Tindakan : "); --backend : DiagnosaTindakanPasien
|
||||
s.append("Rencana Permintaan : [ ");
|
||||
s.append("Laboratorium : ");
|
||||
s.append("Radiologi : ");
|
||||
s.append("Farmasi : ");
|
||||
s.append(" ] ");
|
||||
s.append("Rencana Konsultasi : "); //sudah, tapi antara form dengan domain berbeda
|
||||
s.append("Instruksi Pulang : "); //back end belum
|
||||
s.append("Instruksi Ranap : "); //back end belum
|
||||
s.append("Instruksi Perjanjian : "); //back end belum
|
||||
*/
|
||||
return RestUtil.getJsonResponse(s.toString(), HttpStatus.OK,mapHeaderMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<Collection<SoapVO>> getAllVOWithQueryString(HttpServletRequest request,
|
||||
Integer page, Integer limit, String sort, String dir) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<SoapVO> getVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> addVO(SoapVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> editVO(SoapVO vo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<String> deleteVO(Integer id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<List<SoapVO>> getAllVO() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private String selectSInSOAP(String noCm,String tglInput) {
|
||||
Map<String,Object> keluhanUtama=papkeluhanUtamaService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> resultUmum=anamansisService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> resultKhusus=papAnamesisService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
StringBuffer s=new StringBuffer();
|
||||
|
||||
Boolean dataKeluhanUtama=new Boolean((boolean) keluhanUtama.get("dataFound"));
|
||||
Boolean dataFoundUmum=new Boolean((boolean) resultUmum.get("dataFound"));
|
||||
Boolean dataFoundKhusus=new Boolean((boolean) resultKhusus.get("dataFound"));
|
||||
Boolean dataFound=dataFoundUmum || dataFoundKhusus || dataKeluhanUtama;
|
||||
if(dataFound){
|
||||
if(dataKeluhanUtama)
|
||||
s.append("Keluhan Utama : "+((PapKeluhanUtama)keluhanUtama.get("papKeluhanUtama")).getKeluhanUtama()+", ");
|
||||
|
||||
if(dataFoundUmum){
|
||||
s.append("Umum [ ");
|
||||
s.append("Anamnesis (Suster) : "+((Anamnesis)resultUmum.get("anamansis")).getAnamnesisSuster()+", ");
|
||||
s.append("Anamnesis (Dokter) : "+((Anamnesis)resultUmum.get("anamansis")).getAnamnesisDokter()+".");
|
||||
s.append(" ] ");
|
||||
}
|
||||
if(dataFoundKhusus){
|
||||
s.append("Khusus [ ");
|
||||
s.append("Anamnesis : "+((PapAnamesis)resultKhusus.get("papAnamesis")).getKeluhan()+". ");
|
||||
s.append(" ] ");
|
||||
}
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
} else {
|
||||
s.append("dataFound : ").append(false);
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
private String selectOInSOAP(String noCm,String tglInput) {
|
||||
Map<String,Object> result1=papPernapasanService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result2=papSirkulasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result3=papNeurologiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result4=papGastrointestinalService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result5=papEliminasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result6=papIntegumenService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result7=papMuskuloskeletalService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result8=papGenataliaService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
|
||||
Map<String,Object> result9=papGinekologiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result10=papRehabilitasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result11=papBedahService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result12=papGigiMulutService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result13=papMataService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result14=papThtService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
|
||||
Boolean dataFound1=new Boolean((boolean) result1.get("dataFound"));
|
||||
Boolean dataFound2=new Boolean((boolean) result2.get("dataFound"));
|
||||
Boolean dataFound3=new Boolean((boolean) result3.get("dataFound"));
|
||||
Boolean dataFound4=new Boolean((boolean) result4.get("dataFound"));
|
||||
Boolean dataFound5=new Boolean((boolean) result5.get("dataFound"));
|
||||
Boolean dataFound6=new Boolean((boolean) result6.get("dataFound"));
|
||||
Boolean dataFound7=new Boolean((boolean) result7.get("dataFound"));
|
||||
Boolean dataFound8=new Boolean((boolean) result8.get("dataFound"));
|
||||
|
||||
Boolean dataFound9=new Boolean((boolean) result9.get("dataFound"));
|
||||
Boolean dataFound10=new Boolean((boolean) result10.get("dataFound"));
|
||||
Boolean dataFound11=new Boolean((boolean) result11.get("dataFound"));
|
||||
Boolean dataFound12=new Boolean((boolean) result12.get("dataFound"));
|
||||
Boolean dataFound13=new Boolean((boolean) result13.get("dataFound"));
|
||||
|
||||
Boolean dataFoundUmum = dataFound1 || dataFound2 || dataFound3 || dataFound4
|
||||
|| dataFound5 || dataFound6 || dataFound7 || dataFound8;
|
||||
Boolean dataFoundKhusus = dataFound9 || dataFound10 || dataFound11 || dataFound12 || dataFound13;
|
||||
Boolean dataFound = dataFoundUmum || dataFoundKhusus;
|
||||
StringBuffer s=new StringBuffer();
|
||||
if(dataFound){
|
||||
if(dataFoundUmum){
|
||||
s.append("Umum [ ");
|
||||
if(dataFound1)
|
||||
s.append("Pernapasan : "+(((PapPernapasan) result1.get("papPernapasan")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
if(dataFound2)
|
||||
s.append("Sirkulasi : "+(((PapSirkulasi) result2.get("papSirkulasi")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
if(dataFound3)
|
||||
s.append("Neurologi : "+(((PapNeurologi) result3.get("papNeurologi")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
if(dataFound4)
|
||||
s.append("Gastrointestinal : "+(((PapGastrointestinal) result4.get("papGastrointestinal")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
if(dataFound5)
|
||||
s.append("Eliminasi : "+(((PapEliminasi) result5.get("papEliminasi")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
if(dataFound6)
|
||||
s.append("Integumen : "+(((PapIntegumen) result6.get("papIntegumen")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
if(dataFound7)
|
||||
s.append("Muskuloskeletal : "+(((PapMuskuloskeletal) result7.get("papMuskuloskeletal")).getIsNormal()?"Normal":"Tidak Normal")+", ");
|
||||
if(dataFound8)
|
||||
s.append("Genatalia : "+(((PapGenatalia) result8.get("papGenatalia")).getIsNormal()?"Normal":"Tidak Normal")+".");
|
||||
s.append(" ] ");
|
||||
private String selectPInSOAP(String noCm, String tglInput) {
|
||||
Map<String, Object> result1 = lembarKonsultasiService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
Map<String, Object> result2 = diagnosaTindakanPasienService.findByNoCmAndTglInput(noCm, toDate(tglInput));
|
||||
StringBuilder s = new StringBuilder();
|
||||
Boolean dataFound1 = (boolean) result1.get("dataFound");
|
||||
Boolean dataFound2 = (boolean) result2.get("dataFound");
|
||||
boolean dataFound = dataFound1 || dataFound2;
|
||||
if (dataFound) {
|
||||
if (dataFound1)
|
||||
s.append("Rencana Konsultasi : ")
|
||||
.append(((LembarKonsultasi) result1.get("lembarKonsultasi")).getSaran()).append(", ");
|
||||
if (dataFound2) {
|
||||
s.append("Rencana Tindakan : [ ");
|
||||
for (DetailDiagnosaTindakanPasien detail : ((DiagnosaTindakanPasien) result2
|
||||
.get("diagnosaTindakanPasien")).getDiagnosisTindakan()) {
|
||||
s.append(detail.getDiagnosaTindakan().getNamaDiagnosaTindakan()).append(", ");
|
||||
}
|
||||
}
|
||||
if(dataFoundKhusus){
|
||||
s.append("Khusus [ ");
|
||||
s.append("Ginekologi : "+(((PapGinekologi) result9.get("papGinekologi")).getPengobatan())+", ");
|
||||
s.append("Rehabilitasi : "+(((PapRehabilitasi) result10.get("papRehabilitasi")).getMasalahMedisDanRehabilitasi())+", ");
|
||||
s.append("Bedah : [ ");
|
||||
s.append(" ]");
|
||||
s.append("Gigi Mulut : "+(((PapGigiMulut) result12.get("papGigiMulut")).getPapKeadaanGigi().getName())+", ");
|
||||
//s.append("Mata : "+(((PapMata) result13.get("papMata")).getStreak())+", ");
|
||||
s.append("Obstetri : "+""+", "); //80%
|
||||
s.append("Gizi : "+""+", "); //back end belum (arya)
|
||||
s.append("Tumbuh Kembang Anak : "+""+", "); //back end belum
|
||||
s.append("Psikologi : "+""+", "); //ga ada tglinput (belum integrasi)
|
||||
s.append("THT : "+""+", ");
|
||||
s.append("CLP : "+""+", "); //form belum ada
|
||||
s.append("Bayi Tabung : "+""+", "); //form belum ada (form di adri , backend di susi,tinggal integrasi)
|
||||
s.append("Neonatus : "+""+", "); //form belum ada
|
||||
s.append(" ] ");
|
||||
}
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
} else {
|
||||
s.append("dataFound : ").append(false);
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
private String selectAInSOAP(String noCm,String tglInput) {
|
||||
Map<String,Object> result=diagnosaPasienService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
StringBuffer s=new StringBuffer();
|
||||
|
||||
Boolean dataFound=new Boolean((boolean) result.get("dataFound"));
|
||||
if(dataFound){
|
||||
s.append("Rencana Tindakan : [ "); // backend : DiagnosaPasien
|
||||
for(DetailDiagnosaPasien detail:((DiagnosaPasien) result.get("diagnosaPasien")).getDiagnosis()){
|
||||
s.append(detail.getDiagnosa().getNamaDiagnosa()+", ");
|
||||
}
|
||||
s.append(" ] ");
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
@RequestMapping(value = "/select-detail-for-soap/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> selectDetailForSOAP(
|
||||
@RequestParam(value = "noRec", required = false) String noRec, HttpServletRequest request) {
|
||||
Map<String, Object> list = soapService.findByNoRecAntrian(noRec);
|
||||
Boolean dataFound = (Boolean) list.get("dataFound");
|
||||
if (dataFound) {
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
} else {
|
||||
mapHeaderMessage.put(LABEL_ERROR, getMessage(MessageResource.LABEL_ERROR, request));
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
private String selectPInSOAP(String noCm,String tglInput) {
|
||||
Map<String,Object> result1=lembarKonsultasiService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
Map<String,Object> result2=diagnosaTindakanPasienService.findByNoCmAndTglInput(noCm, DateUtil.toDate(tglInput));
|
||||
StringBuffer s=new StringBuffer();
|
||||
Boolean dataFound1=new Boolean((boolean) result1.get("dataFound"));
|
||||
Boolean dataFound2=new Boolean((boolean) result2.get("dataFound"));
|
||||
Boolean dataFound=dataFound1 || dataFound2;
|
||||
if(dataFound){
|
||||
if(dataFound1)
|
||||
s.append("Rencana Konsultasi : "+(((LembarKonsultasi) result1.get("lembarKonsultasi")).getSaran())+", ");
|
||||
if(dataFound2){
|
||||
s.append("Rencana Tindakan : [ ");
|
||||
for(DetailDiagnosaTindakanPasien detail:((DiagnosaTindakanPasien) result2.get("diagnosaTindakanPasien")).getDiagnosisTindakan()){
|
||||
s.append(detail.getDiagnosaTindakan().getNamaDiagnosaTindakan()+", ");
|
||||
}}
|
||||
s.append(" ] ");
|
||||
}else{
|
||||
s.append("dataFound : "+dataFound);
|
||||
}
|
||||
|
||||
/*
|
||||
StringBuffer s=new StringBuffer();
|
||||
s.append("Rencana Tindakan : "); --backend : DiagnosaTindakanPasien
|
||||
s.append("Rencana Permintaan : [ ");
|
||||
s.append("Laboratorium : ");
|
||||
s.append("Radiologi : ");
|
||||
s.append("Farmasi : ");
|
||||
s.append(" ] ");
|
||||
s.append("Rencana Konsultasi : "); //sudah, tapi antara form dengan domain berbeda
|
||||
s.append("Instruksi Pulang : "); //back end belum
|
||||
s.append("Instruksi Ranap : "); //back end belum
|
||||
s.append("Instruksi Perjanjian : "); //back end belum
|
||||
*/
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/select-detail-for-soap/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> selectDetailForSOAP(@RequestParam(value = "noRec", required = false) String noRec,HttpServletRequest request) {
|
||||
Boolean dataFound=false;
|
||||
Map<String,Object> list=soapService.findByNoRecAntrian(noRec);
|
||||
dataFound=(Boolean) list.get("dataFound");
|
||||
if(dataFound){
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
}else{
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_ERROR,getMessage(MessageResource.LABEL_ERROR,request ));
|
||||
}
|
||||
return RestUtil.getJsonResponse(list, HttpStatus.OK,mapHeaderMessage);
|
||||
return getJsonResponse(list, OK, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.impl.SocketClientServiceImpl;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/client-socket")
|
||||
public class SocketClientController extends LocaleController{
|
||||
|
||||
@Autowired
|
||||
private SocketClientServiceImpl service;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SocketClientController.class);
|
||||
|
||||
@RequestMapping(value = "/cetak-data", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> connectToWinSock(@Valid @RequestBody Map<String, Object> vo, HttpServletRequest request) {
|
||||
try {
|
||||
Map<String,Object> result = service.connectToWinSock(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when connectToWinSock", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when connectToWinSock", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,48 +1,41 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SppbService;
|
||||
import com.jasamedika.medifirst2000.vo.SppbVO;
|
||||
import com.jasamedika.medifirst2000.vo.VerifikasiSppbVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SppbService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.RegistrasiPelayananVO;
|
||||
import com.jasamedika.medifirst2000.vo.SppbVO;
|
||||
import com.jasamedika.medifirst2000.vo.VerifikasiSppbVO;
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sppb")
|
||||
public class SppbController extends LocaleController<RegistrasiPelayananVO> {
|
||||
public class SppbController extends LocaleController<SppbVO> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SppbController.class);
|
||||
|
||||
@Autowired
|
||||
private SppbService service;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SppbController.class);
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping(value = "/pre-add-sppb")
|
||||
@ResponseBody
|
||||
public Map<String, Object> preAddSppb(
|
||||
@ -53,13 +46,9 @@ public class SppbController extends LocaleController<RegistrasiPelayananVO> {
|
||||
@RequestParam(value = "dateStart", required = false) String dateStart,
|
||||
@RequestParam(value = "dateEnd", required = false) String dateEnd,
|
||||
@RequestParam(value = "supplierId", required = false) Integer supplierId) {
|
||||
|
||||
Map<String, Object> resultPageMap = service.preAddSppb(page, limit, sort, dir, dateStart, dateEnd, supplierId);
|
||||
|
||||
return resultPageMap;
|
||||
return service.preAddSppb(page, limit, sort, dir, dateStart, dateEnd, supplierId);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@RequestMapping(value = "/list-sppb")
|
||||
@ResponseBody
|
||||
public Map<String, Object> listSppb(
|
||||
@ -70,108 +59,93 @@ public class SppbController extends LocaleController<RegistrasiPelayananVO> {
|
||||
@RequestParam(value = "dateStart", required = false) String dateStart,
|
||||
@RequestParam(value = "dateEnd", required = false) String dateEnd,
|
||||
@RequestParam(value = "supplierId", required = false) Integer supplierId) {
|
||||
return service.daftarSppb(page, limit, sort, dir, dateStart, dateEnd, supplierId);
|
||||
}
|
||||
|
||||
Map<String, Object> resultPageMap = service.daftarSppb(page, limit, sort, dir, dateStart, dateEnd, supplierId);
|
||||
@RequestMapping(value = "/detail-kontrak", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> getKontrak(@RequestParam(value = "noRec") String noRec) {
|
||||
return service.detailKontrak(noRec);
|
||||
}
|
||||
|
||||
return resultPageMap;
|
||||
@RequestMapping(value = "/detail-sppb", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> getSppb(@RequestParam(value = "noRec") String noRec) {
|
||||
return service.detailSppb(noRec);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/detail-kontrak", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> getKontrak(
|
||||
@RequestParam(value = "noRec", required = true) String noRec) {
|
||||
Map<String, Object> kartuPengendliDetailList = service.detailKontrak(noRec);
|
||||
return kartuPengendliDetailList;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/detail-sppb", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> getSppb(@RequestParam(value = "noRec", required = true) String noRec) {
|
||||
Map<String, Object> sppbList = service.detailSppb(noRec);
|
||||
return sppbList;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/save-sppb/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> saveSppb(@Valid @RequestBody SppbVO vo,HttpServletRequest request,HttpServletResponse response) {
|
||||
|
||||
|
||||
@RequestMapping(value = "/save-sppb/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> saveSppb(@Valid @RequestBody SppbVO vo, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
try {
|
||||
Map<String, Object> result = service.saveSppb(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when save Sppb", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when saveSppb", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when save Sppb", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when saveSppb", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Verifikasi by Anggaran By Header
|
||||
@RequestMapping(value = "/verifikasi-sppb", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> verifikasiSppb(
|
||||
@Valid @RequestBody VerifikasiSppbVO vo, HttpServletRequest request) {
|
||||
|
||||
@RequestMapping(value = "/verifikasi-sppb", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> verifikasiSppb(@Valid @RequestBody VerifikasiSppbVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = service.verifikasiSppb(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when Verif Sppb", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when verifikasiSppb", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when Verif Sppb", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when verifikasiSppb", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Verifikasi by Anggaran By Header
|
||||
@RequestMapping(value = "/unverifikasi-sppb", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> unverifikasiSppb(@Valid @RequestBody VerifikasiSppbVO vo,HttpServletRequest request) {
|
||||
|
||||
@RequestMapping(value = "/unverifikasi-sppb", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> unverifikasiSppb(@Valid @RequestBody VerifikasiSppbVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = service.unverifikasiSppb(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when un Verif Sppb", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when unverifikasiSppb", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when un Verif Sppb", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when unverifikasiSppb", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update-sppb/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> updateSppb(@Valid @RequestBody SppbVO vo,HttpServletRequest request,HttpServletResponse response) {
|
||||
|
||||
|
||||
@RequestMapping(value = "/update-sppb/", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> updateSppb(@Valid @RequestBody SppbVO vo, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
try {
|
||||
Map<String, Object> result = service.updateSppb(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when save Sppb", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when updateSppb", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when save Sppb", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when updateSppb", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,58 +1,54 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
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.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.dto.StandarPelayananMakananDto;
|
||||
import com.jasamedika.medifirst2000.service.StandarPelayananMakananService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/standar-pelayanan-makanan")
|
||||
public class StandarPelayananMakananController extends LocaleController {
|
||||
public class StandarPelayananMakananController extends LocaleController<StandarPelayananMakananDto> {
|
||||
|
||||
@Autowired
|
||||
private StandarPelayananMakananService standarPelayananMakananService;
|
||||
|
||||
@RequestMapping(value="/save/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<List<Map<String, Object>>> saveData(
|
||||
@RequestBody List<StandarPelayananMakananDto> dtos,
|
||||
|
||||
@RequestMapping(value = "/save/", method = POST, produces = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<List<Map<String, Object>>> saveData(@RequestBody List<StandarPelayananMakananDto> dtos,
|
||||
HttpServletRequest request) {
|
||||
List<Map<String, Object>> result = this.standarPelayananMakananService.save(dtos);
|
||||
if (!result.isEmpty()) {
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, OK, mapHeaderMessage);
|
||||
}
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
}
|
||||
|
||||
@RequestMapping(value="/get-all/",
|
||||
method=RequestMethod.GET,
|
||||
produces=MediaType.APPLICATION_JSON_VALUE)
|
||||
|
||||
@RequestMapping(value = "/get-all/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> getDataAll(HttpServletRequest request) {
|
||||
Map<String, Object> result = this.standarPelayananMakananService.getStandarPelayananMakanan();
|
||||
return result;
|
||||
return this.standarPelayananMakananService.getStandarPelayananMakanan();
|
||||
}
|
||||
|
||||
@RequestMapping(value="/get-ruangan/",
|
||||
method=RequestMethod.GET,
|
||||
produces=MediaType.APPLICATION_JSON_VALUE)
|
||||
|
||||
@RequestMapping(value = "/get-ruangan/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> getRuangan(HttpServletRequest request) {
|
||||
Map<String, Object> result = this.standarPelayananMakananService.getRuangan();
|
||||
return result;
|
||||
return this.standarPelayananMakananService.getRuangan();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,136 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SterilisasiAlatService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SterilisasiAlatVO;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sterilisasi-alat")
|
||||
public class SterilisasiAlatController extends LocaleController<SterilisasiAlatVO> {
|
||||
|
||||
@Autowired
|
||||
private SterilisasiAlatService sterilisasiAlatService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
.getLogger(SterilisasiAlatController.class);
|
||||
|
||||
@RequestMapping(value = "/save-sterilisasi-alat/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> addVO(@Valid @RequestBody SterilisasiAlatVO vo,HttpServletRequest request) {
|
||||
|
||||
try{
|
||||
Map<String, Object> result = sterilisasiAlatService.addSterilisasiAlat(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add SterilisasiAlat", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add SterilisasiAlat", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update-sterilisasi-alat/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> updateVO(@Valid @RequestBody SterilisasiAlatVO vo,HttpServletRequest request) {
|
||||
|
||||
try{
|
||||
Map<String, Object> result = sterilisasiAlatService.updateSterilisasiAlat(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when update SterilisasiAlat", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when update SterilisasiAlat", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-all-sterilisasi-alat/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> getAllVO(HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
Map<String,Object> result=sterilisasiAlatService.findAllSterilisasiAlat();
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when get all sterilisasi alat", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when get all sterilisasi alat", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/delete-sterilisasi-alat", method = RequestMethod.GET)
|
||||
public ResponseEntity<String> deleteNamaBahan(@RequestParam(value = "noRec", required = true) String noRec) {
|
||||
|
||||
try {
|
||||
if (sterilisasiAlatService.deleteSterilisasiAlat(noRec) == true)
|
||||
return RestUtil.getJsonResponse(noRec +" Dihapus", HttpStatus.CREATED);
|
||||
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when delete sterilisasi alat", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when delete sterilisasi alat", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.NOT_ACCEPTABLE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,109 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SterilisasiAlatExternalService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SterilisasiAlatExternalVO;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sterilisasi-alat-external")
|
||||
public class SterilisasiAlatExternalController extends LocaleController<SterilisasiAlatExternalVO> {
|
||||
|
||||
@Autowired
|
||||
private SterilisasiAlatExternalService sterilisasiAlatExternalService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SterilisasiAlatExternalController.class);
|
||||
|
||||
@RequestMapping(value = "/save-sterilisasi-alat-external/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> addVO(@Valid @RequestBody SterilisasiAlatExternalVO vo,HttpServletRequest request) {
|
||||
|
||||
try{
|
||||
Map<String, Object> result = sterilisasiAlatExternalService.addSterilisasiAlatExternal(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add Sterilisasi alat external", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add Sterilisasi alat externalo", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update-sterilisasi-alat-external/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> updateVO(@Valid @RequestBody SterilisasiAlatExternalVO vo,HttpServletRequest request) {
|
||||
|
||||
try{
|
||||
Map<String, Object> result = sterilisasiAlatExternalService.updateSterilisasiAlatExternal(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when update Sterilisasi alat external", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when update Sterilisasi alat externalo", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-all-sterilisasi-alat-external/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> getAllVO(HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
Map<String,Object> result=sterilisasiAlatExternalService.findAllSterilisasiAlatExternal();
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when get all SterilisasiAlatExternal", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when get all SterilisasiAlatExternal", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,110 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.SterilisasiAlatMesinEoService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.SterilisasiAlatMesinEoVO;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/sterilisasi-alat-mesin-eo")
|
||||
public class SterilisasiAlatMesinEoController extends LocaleController<SterilisasiAlatMesinEoVO> {
|
||||
|
||||
@Autowired
|
||||
private SterilisasiAlatMesinEoService sterilisasiAlatMesinEoService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory
|
||||
.getLogger(PencatatanSuhuMesinController.class);
|
||||
|
||||
@RequestMapping(value = "/save-sterilisasi-alat-mesin-eo/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> addVO(@Valid @RequestBody SterilisasiAlatMesinEoVO vo,HttpServletRequest request) {
|
||||
|
||||
try{
|
||||
Map<String, Object> result = sterilisasiAlatMesinEoService.addSterilisasiMesinEo(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when add Sterilisasi alat menggunakan mesin eo", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when add Sterilisasi alat menggunakan mesin eo", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/update-sterilisasi-alat-mesin-eo/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> updateVO(@Valid @RequestBody SterilisasiAlatMesinEoVO vo,HttpServletRequest request) {
|
||||
|
||||
try{
|
||||
Map<String, Object> result = sterilisasiAlatMesinEoService.addSterilisasiMesinEo(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS,request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when update Sterilisasi alat menggunakan mesin eo", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when update Sterilisasi alat menggunakan mesin eo", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/find-all-sterilisasi-alat-mesin-eo/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String,Object>> getAllVO(HttpServletRequest request) {
|
||||
|
||||
try {
|
||||
Map<String,Object> result=sterilisasiAlatMesinEoService.findAllSterilisasiAlatMesinEo();
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS,request ));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED,mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when get all Sterilisasi alat menggunakan mesin eo", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when get all Sterilisasi alat menggunakan mesin eo", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE,
|
||||
jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT,
|
||||
mapHeaderMessage);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.service.StokMinimumPerDepoService;
|
||||
import com.jasamedika.medifirst2000.vo.StokProdukGlobalVO;
|
||||
|
||||
/**
|
||||
* Controller class for Registrasi Pasien Business
|
||||
*
|
||||
* @author Adik
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stok-minimum-per-depo")
|
||||
public class StokMinimumPerDepoController extends LocaleController<StokProdukGlobalVO> {
|
||||
|
||||
@Autowired
|
||||
private StokMinimumPerDepoService stokMinimumPerDepoService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(StokMinimumPerDepoController.class);
|
||||
|
||||
@RequestMapping(value = "/get-all-stok-minimum-per-depo", method = RequestMethod.GET)
|
||||
public Map<String, Object> findAllAntrianPaging(String dari,String kepada) {
|
||||
Map<String,Object> result=stokMinimumPerDepoService.getAllStokProdukGlobal(dari, kepada);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,92 +1,78 @@
|
||||
package com.jasamedika.medifirst2000.controller;
|
||||
|
||||
import java.util.Map;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.StokOpNameService;
|
||||
import com.jasamedika.medifirst2000.vo.StokOpNameVO;
|
||||
import com.jasamedika.medifirst2000.vo.StrukClosingVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.orm.jpa.JpaSystemException;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.jasamedika.medifirst2000.constants.Constants;
|
||||
import com.jasamedika.medifirst2000.constants.MessageResource;
|
||||
import com.jasamedika.medifirst2000.controller.base.LocaleController;
|
||||
import com.jasamedika.medifirst2000.core.web.WebConstants;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.StokOpNameService;
|
||||
import com.jasamedika.medifirst2000.util.rest.RestUtil;
|
||||
import com.jasamedika.medifirst2000.vo.StokOpNameVO;
|
||||
import static com.jasamedika.medifirst2000.constants.Constants.MessageInfo.ERROR_MESSAGE;
|
||||
import static com.jasamedika.medifirst2000.core.web.WebConstants.HttpHeaderInfo.LABEL_SUCCESS;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonHttpStatus;
|
||||
import static com.jasamedika.medifirst2000.util.rest.RestUtil.getJsonResponse;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.springframework.http.HttpStatus.*;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.GET;
|
||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/stok-op-name")
|
||||
public class StokOpNameController extends LocaleController {
|
||||
|
||||
public class StokOpNameController extends LocaleController<StrukClosingVO> {
|
||||
|
||||
private static final Logger LOGGER = getLogger(StokOpNameController.class);
|
||||
|
||||
@Autowired
|
||||
private StokOpNameService stokOpNameService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(RequestPermintaanBarangController.class);
|
||||
|
||||
|
||||
@RequestMapping(value = "/list-stok-op-name")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getStokGlobalByProduk(
|
||||
@RequestParam(value = "kelompokProdukId", required = false) Integer kelompokProdukId,
|
||||
@RequestParam(value = "produkId", required = false) Integer produkId,
|
||||
@RequestParam(value = "jenisProdukId", required = false) Integer jenisProdukId) {
|
||||
|
||||
Map<String, Object> resultPageMap = stokOpNameService.getStokGlobalByProduk(kelompokProdukId,produkId,jenisProdukId);
|
||||
|
||||
return resultPageMap;
|
||||
return stokOpNameService.getStokGlobalByProduk(kelompokProdukId, produkId, jenisProdukId);
|
||||
}
|
||||
|
||||
// save kartu Pengendali
|
||||
@RequestMapping(value = "/save-stok-op-name", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
|
||||
@RequestMapping(value = "/save-stok-op-name", method = POST, produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<Map<String, Object>> saveStokOpName(@Valid @RequestBody StokOpNameVO vo,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> result = stokOpNameService.saveStokOpName(vo);
|
||||
if (null != result)
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.CREATED, mapHeaderMessage);
|
||||
|
||||
mapHeaderMessage.put(LABEL_SUCCESS, getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return getJsonResponse(result, CREATED, mapHeaderMessage);
|
||||
} catch (ServiceVOException e) {
|
||||
LOGGER.error("Got exception {} when saveKartuPengendali", e.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, e.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
LOGGER.error("Got ServiceVOException {} when saveStokOpName", e.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, e.getMessage());
|
||||
return getJsonHttpStatus(INTERNAL_SERVER_ERROR, mapHeaderMessage);
|
||||
} catch (JpaSystemException jse) {
|
||||
LOGGER.error("Got exception {} when saveKartuPengendali", jse.getMessage());
|
||||
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
|
||||
return RestUtil.getJsonHttpStatus(HttpStatus.CONFLICT, mapHeaderMessage);
|
||||
LOGGER.error("Got JpaSystemException {} when saveStokOpName", jse.getMessage());
|
||||
addHeaderMessage(ERROR_MESSAGE, jse.getMessage());
|
||||
return getJsonHttpStatus(CONFLICT, mapHeaderMessage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/grid-stok-op-name")
|
||||
@ResponseBody
|
||||
public Map<String, Object> gridStokOpName(
|
||||
@RequestParam(value = "tanggalAwal", required = false) String tanggalAwal,
|
||||
public Map<String, Object> gridStokOpName(@RequestParam(value = "tanggalAwal", required = false) String tanggalAwal,
|
||||
@RequestParam(value = "tanggalAhir", required = false) String tanggalAhir) {
|
||||
|
||||
Map<String, Object> resultPageMap = stokOpNameService.gridStokOpName(tanggalAwal,tanggalAhir);
|
||||
|
||||
return resultPageMap;
|
||||
return stokOpNameService.gridStokOpName(tanggalAwal, tanggalAhir);
|
||||
}
|
||||
|
||||
// Menampilkan Kartu Pengendali Berdasarkan Norec (array)
|
||||
@RequestMapping(value = "/get-stok-op-name-detail/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> kartuPengendliDetailList(@RequestParam(value = "tglClosing", required = true) String tglClosing) {
|
||||
Map<String, Object> kartuPengendliDetailList = stokOpNameService.detailStokOpName(tglClosing);
|
||||
return kartuPengendliDetailList;
|
||||
|
||||
@RequestMapping(value = "/get-stok-op-name-detail/", method = GET, produces = APPLICATION_JSON_VALUE)
|
||||
public Map<String, Object> kartuPengendliDetailList(@RequestParam(value = "tglClosing") String tglClosing) {
|
||||
return stokOpNameService.detailStokOpName(tglClosing);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user