Update SkoringTindakanNakesService
Perbaikan service pengecekan mapping skoring duplikat saat simpan edit skoring tindakan nakes lain
This commit is contained in:
parent
1900b110a3
commit
a91e861d10
@ -67,7 +67,9 @@ public interface SkoringTindakanNakesDao extends PagingAndSortingRepository<Skor
|
|||||||
String strCekDupSkoring = "select stn.noRec " + "from SkoringTindakanNakes stn " + "inner join stn.produk prn "
|
String strCekDupSkoring = "select stn.noRec " + "from SkoringTindakanNakes stn " + "inner join stn.produk prn "
|
||||||
+ "inner join prn.profesi pfs " + "where stn.statusEnabled is true "
|
+ "inner join prn.profesi pfs " + "where stn.statusEnabled is true "
|
||||||
+ "and lower(regexp_replace(prn.namaProduk,:patternText,'','g')) = :namaProduk "
|
+ "and lower(regexp_replace(prn.namaProduk,:patternText,'','g')) = :namaProduk "
|
||||||
+ "and pfs.id = :profesiId " + "and stn.skor = :skor";
|
+ "and pfs.id = :profesiId ";
|
||||||
|
|
||||||
|
String skor = " and stn.skor = :skor";
|
||||||
|
|
||||||
String tglBerlaku = " and to_char(stn.tanggalMulaiBerlaku,'yyyy-MM-dd') = :tglMulaiBerlaku";
|
String tglBerlaku = " and to_char(stn.tanggalMulaiBerlaku,'yyyy-MM-dd') = :tglMulaiBerlaku";
|
||||||
|
|
||||||
@ -75,23 +77,22 @@ public interface SkoringTindakanNakesDao extends PagingAndSortingRepository<Skor
|
|||||||
|
|
||||||
String sortTglBerlaku = " order by stn.tanggalMulaiBerlaku desc";
|
String sortTglBerlaku = " order by stn.tanggalMulaiBerlaku desc";
|
||||||
|
|
||||||
@Query(strCekDupSkoring + sortTglBerlaku)
|
@Query(strCekDupSkoring + skor + sortTglBerlaku)
|
||||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
||||||
@Param("skor") Double skor, @Param("patternText") String patternText);
|
@Param("skor") Double skor, @Param("patternText") String patternText);
|
||||||
|
|
||||||
@Query(strCekDupSkoring + tglBerlaku)
|
@Query(strCekDupSkoring + tglBerlaku)
|
||||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
||||||
@Param("skor") Double skor, @Param("tglMulaiBerlaku") String tglMulaiBerlaku,
|
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText);
|
||||||
@Param("patternText") String patternText);
|
|
||||||
|
|
||||||
@Query(strCekDupSkoring + idSkoring + sortTglBerlaku)
|
@Query(strCekDupSkoring + skor + idSkoring + sortTglBerlaku)
|
||||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
||||||
@Param("skor") Double skor, @Param("patternText") String patternText, @Param("noRec") String noRec);
|
@Param("skor") Double skor, @Param("patternText") String patternText, @Param("noRec") String noRec);
|
||||||
|
|
||||||
@Query(strCekDupSkoring + tglBerlaku + idSkoring)
|
@Query(strCekDupSkoring + tglBerlaku + idSkoring)
|
||||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("profesiId") Integer idProfesi,
|
||||||
@Param("skor") Double skor, @Param("tglMulaiBerlaku") String tglMulaiBerlaku,
|
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText,
|
||||||
@Param("patternText") String patternText, @Param("noRec") String noRec);
|
@Param("noRec") String noRec);
|
||||||
|
|
||||||
@Query("select new Map(stn.noRec as noRec,stn.skor as skor," + "prn.namaProduk as namaProduk,"
|
@Query("select new Map(stn.noRec as noRec,stn.skor as skor," + "prn.namaProduk as namaProduk,"
|
||||||
+ "pfs.namaProfesi as namaProfesi) " + "from SkoringTindakanNakes stn " + "inner join stn.produk prn "
|
+ "pfs.namaProfesi as namaProfesi) " + "from SkoringTindakanNakes stn " + "inner join stn.produk prn "
|
||||||
|
|||||||
@ -254,13 +254,13 @@ public class SkoringTindakanNakesServiceImpl extends BaseVoServiceImpl implement
|
|||||||
if (CommonUtil.isNotNullOrEmpty(noRec)) {
|
if (CommonUtil.isNotNullOrEmpty(noRec)) {
|
||||||
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, idProfesi, skor, patternText, noRec);
|
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, idProfesi, skor, patternText, noRec);
|
||||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, idProfesi, skor,
|
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, idProfesi,
|
||||||
df.format(new Date(tglMulaiBerlaku)), patternText, noRec);
|
df.format(new Date(tglMulaiBerlaku)), patternText, noRec);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, idProfesi, skor, patternText);
|
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, idProfesi, skor, patternText);
|
||||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, idProfesi, skor,
|
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, idProfesi,
|
||||||
df.format(new Date(tglMulaiBerlaku)), patternText);
|
df.format(new Date(tglMulaiBerlaku)), patternText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user