perbaikan get daftar tindakan di menu skoring tindakan medis

This commit is contained in:
salmanoe 2021-02-24 11:52:52 +07:00
parent 74d1fafb0a
commit c2b171e178
4 changed files with 40 additions and 0 deletions

View File

@ -322,4 +322,11 @@ public interface ProdukDao extends PagingAndSortingRepository<Produk, Integer> {
+ "left join pk.jenisPaket jpk " + "left join pd.satuanStandar ss " + "where pd.id = mpp.produkId "
+ "and mpp.id = :idMapping")
public Map<String, Object> getMappingPaketToProduk(@Param("idMapping") Integer idMapping);
@Query("select distinct new Map(prd.id as id, prd.namaProduk as namaProduk) "
+ "from MapRuanganToProduk mpr, HargaNettoProdukByKelas hnp " + "inner join mpr.produk prd "
+ "inner join mpr.ruangan ru " + "inner join hnp.kelas kls " + "where mpr.produkId = hnp.produkId "
+ "and mpr.ruanganId = :ruanganId " + "and hnp.statusEnabled is true " + "and mpr.kodeExternal = '2017' "
+ "and hnp.kodeExternal = '2017' " + "order by prd.namaProduk")
List<Map<String, Object>> findDaftarInputTindakanByRuangan(@Param("ruanganId") Integer idRuangan);
}

View File

@ -11,4 +11,6 @@ public interface SkoringTindakanMedisService
List<Map<String, Object>> findAllEnabled();
List<Map<String, Object>> findDaftarInputTindakanByRuanganKelas(Integer idRuangan);
}

View File

@ -9,6 +9,7 @@ import org.springframework.orm.jpa.JpaSystemException;
import org.springframework.stereotype.Service;
import com.jasamedika.medifirst2000.converter.BaseConverterImpl;
import com.jasamedika.medifirst2000.dao.ProdukDao;
import com.jasamedika.medifirst2000.dao.SkoringTindakanMedisDao;
import com.jasamedika.medifirst2000.entities.Produk;
import com.jasamedika.medifirst2000.entities.SkoringTindakanMedis;
@ -34,6 +35,9 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
@Autowired
private SkoringTindakanMedisDao skoringTindakanMedisDao;
@Autowired
private ProdukDao produkDao;
@Override
public SkoringTindakanMedisVO add(SkoringTindakanMedisVO vo) throws JpaSystemException, ServiceVOException {
@ -117,4 +121,11 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
return result;
}
@Override
public List<Map<String, Object>> findDaftarInputTindakanByRuanganKelas(Integer idRuangan) {
List<Map<String, Object>> result = produkDao.findDaftarInputTindakanByRuangan(idRuangan);
return result;
}
}

View File

@ -339,6 +339,26 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
}
}
@RequestMapping(value = "/get-daftar-input-tindakan", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getDaftarInputTindakan(HttpServletRequest request,
@RequestParam(value = "ruanganId", required = true) Integer idRuangan) throws ParseException {
try {
List<Map<String, Object>> result = skoringTindakanMedisService
.findDaftarInputTindakanByRuanganKelas(idRuangan);
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
getMessage(MessageResource.LABEL_SUCCESS, request));
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
} catch (ServiceVOException sve) {
LOGGER.error("Got exception {} when get daftar input tindakan", sve.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, sve.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.INTERNAL_SERVER_ERROR, mapHeaderMessage);
} catch (JpaSystemException jse) {
LOGGER.error("Got exception {} when get daftar input tindakan", jse.getMessage());
addHeaderMessage(Constants.MessageInfo.ERROR_MESSAGE, jse.getMessage());
return RestUtil.getJsonHttptatus(HttpStatus.CONFLICT, mapHeaderMessage);
}
}
@RequestMapping(value = "/get-all-skoring-tindakan-medis", method = RequestMethod.GET)
public ResponseEntity<List<Map<String, Object>>> getAllSkoringTindakanMedis(HttpServletRequest request)
throws ParseException {