Update SkoringTindakanPerawatService
Perbaikan service pengecekan mapping skoring duplikat saat simpan edit skoring tindakan perawat
This commit is contained in:
parent
3484b994c0
commit
1900b110a3
@ -63,7 +63,9 @@ public interface SkoringTindakanPerawatDao extends PagingAndSortingRepository<Sk
|
||||
|
||||
String strCekDupSkoring = "select stp.noRec " + "from SkoringTindakanPerawat stp " + "inner join stp.produk prp "
|
||||
+ "where stp.statusEnabled is true "
|
||||
+ "and lower(regexp_replace(prp.namaProduk,:patternText,'','g')) = :namaProduk " + "and stp.skor = :skor";
|
||||
+ "and lower(regexp_replace(prp.namaProduk,:patternText,'','g')) = :namaProduk";
|
||||
|
||||
String skor = " and stp.skor = :skor";
|
||||
|
||||
String tglBerlaku = " and to_char(stp.tanggalMulaiBerlaku,'yyyy-MM-dd') = :tglMulaiBerlaku";
|
||||
|
||||
@ -71,20 +73,20 @@ public interface SkoringTindakanPerawatDao extends PagingAndSortingRepository<Sk
|
||||
|
||||
String sortTglBerlaku = " order by stp.tanggalMulaiBerlaku desc";
|
||||
|
||||
@Query(strCekDupSkoring + sortTglBerlaku)
|
||||
@Query(strCekDupSkoring + skor + sortTglBerlaku)
|
||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
@Param("patternText") String patternText);
|
||||
|
||||
@Query(strCekDupSkoring + tglBerlaku)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk,
|
||||
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText);
|
||||
|
||||
@Query(strCekDupSkoring + idSkoring + sortTglBerlaku)
|
||||
@Query(strCekDupSkoring + skor + idSkoring + sortTglBerlaku)
|
||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
@Param("patternText") String patternText, @Param("noRec") String noRec);
|
||||
|
||||
@Query(strCekDupSkoring + tglBerlaku + idSkoring)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk,
|
||||
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText,
|
||||
@Param("noRec") String noRec);
|
||||
|
||||
|
||||
@ -231,14 +231,14 @@ public class SkoringTindakanPerawatServiceImpl extends BaseVoServiceImpl impleme
|
||||
if (CommonUtil.isNotNullOrEmpty(noRec)) {
|
||||
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, skor, patternText, noRec);
|
||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, skor,
|
||||
df.format(new Date(tglMulaiBerlaku)), patternText, noRec);
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, df.format(new Date(tglMulaiBerlaku)),
|
||||
patternText, noRec);
|
||||
}
|
||||
} else {
|
||||
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, skor, patternText);
|
||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, skor,
|
||||
df.format(new Date(tglMulaiBerlaku)), patternText);
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, df.format(new Date(tglMulaiBerlaku)),
|
||||
patternText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user