From 76d623731ba21ea956b2c9b2272eb1caf8661b06 Mon Sep 17 00:00:00 2001 From: vietdd Date: Thu, 21 Oct 2021 15:08:52 +0700 Subject: [PATCH 1/3] =?UTF-8?q?fix=20l=E1=BB=97i=20x=C3=B3a=20ng=C6=B0?= =?UTF-8?q?=E1=BB=9Di=20ti=C3=AAm=20ch=E1=BB=A7ng=20kh=C3=B4ng=20x=C3=B3a?= =?UTF-8?q?=20h=E1=BA=BFt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/encodings.xml | 6 +++++ .idea/jarRepositories.xml | 20 ++++++++++++++++ .idea/workspace.xml | 11 +++++++-- .../vcmgt/action/NguoiTiemChungAction.java | 2 ++ .../action/impl/NguoiTiemChungActionImpl.java | 12 +++++++++- .../vcmgt/controler/ApplicationControler.java | 24 ++++++++++++++----- .../repository/NguoiTiemChungRepository.java | 2 ++ .../vcmgt/service/NguoiTiemChungService.java | 2 ++ .../impl/NguoiTiemChungServiceImpl.java | 5 ++++ 9 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 00000000..dfc8d742 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 00000000..712ab9d9 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3430a9f9..bf5c71dd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,15 @@ - - + + + + + + + + + - - - + - - + + + - - - + + + @@ -433,7 +439,6 @@ - @@ -458,6 +463,7 @@ - \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index baffeecf..a3811117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -119,4 +119,9 @@ + Thêm thời gian vào trang hiển thị danh sách lịch tiêm + fix cơ chế lấy danh sách lịch tiêm chủng trong ds gọi tiêm (size = -1, page = -1) + Thêm cột tên lịch -+ Sửa lại filter toàn bộ trong màn hình gọi tiêm \ No newline at end of file ++ Sửa lại filter toàn bộ trong màn hình gọi tiêm + + +#update 21/10/2021 ++ Sửa lỗi xóa không hết người tiêm chủng trong danh sách ban đầu ++ Fix lỗi dublicate phiếu hẹn \ No newline at end of file diff --git a/backend/src/main/java/org/vaccom/vcmgt/action/PhieuHenTiemAction.java b/backend/src/main/java/org/vaccom/vcmgt/action/PhieuHenTiemAction.java index 7191cc05..abccbea2 100644 --- a/backend/src/main/java/org/vaccom/vcmgt/action/PhieuHenTiemAction.java +++ b/backend/src/main/java/org/vaccom/vcmgt/action/PhieuHenTiemAction.java @@ -54,5 +54,6 @@ public List searchPhieuHenTiem(long lichTiemChungId, long caTiemCh public PhieuHenTiem update(PhieuHenTiem phieuHenTiem); + public List findExist(long lichTiemChungId, long nguoiTiemChungId); } diff --git a/backend/src/main/java/org/vaccom/vcmgt/action/impl/PhieuHenTiemActionImpl.java b/backend/src/main/java/org/vaccom/vcmgt/action/impl/PhieuHenTiemActionImpl.java index 9fbec68d..672722d3 100644 --- a/backend/src/main/java/org/vaccom/vcmgt/action/impl/PhieuHenTiemActionImpl.java +++ b/backend/src/main/java/org/vaccom/vcmgt/action/impl/PhieuHenTiemActionImpl.java @@ -455,6 +455,11 @@ public PhieuHenTiem update(PhieuHenTiem phieuHenTiem) { return phieuHenTiemService.update(phieuHenTiem); } + @Override + public List findExist(long lichTiemChungId, long nguoiTiemChungId) { + return phieuHenTiemService.findExist(lichTiemChungId, nguoiTiemChungId); + } + private final Log _log = LogFactory.getLog(PhieuHenTiemActionImpl.class); } diff --git a/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java b/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java index 989aa12c..b44585bb 100644 --- a/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java +++ b/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java @@ -2081,32 +2081,40 @@ public ResponseEntity addPhieuHenTiemList(HttpServletRequest request, HttpSer } else { lanTiem = muiTiemChungList.size() + 1; } + List findExist = phieuHenTiemAction.findExist(phieuHenTiemDto.LichTiemChungID, nguoiTiemChungID); if (Validator.isNull(nguoiTiemChung)) { return ResponseEntity.status(HttpStatus.NOT_FOUND) .body(MessageUtil.getVNMessageText("nguoiTiemChung.chitiet.not_found")); } - PhieuHenTiem phieuHenTiem = new PhieuHenTiem(); - - phieuHenTiem.setGioHenTiem(lichTiemChung.getGioHenTiem()); - phieuHenTiem.setLichTiemChungId(lichTiemChung.getId()); - phieuHenTiem.setCaTiemChungId(0); - phieuHenTiem.setNgayHenTiem(lichTiemChung.getNgayBatDau()); - phieuHenTiem.setNguoiTiemChungId(nguoiTiemChung.getId()); - phieuHenTiem.setMaQR(VaccomUtil.generateQRCode("pht", 4)); - phieuHenTiem.setLanTiem(lanTiem); - phieuHenTiem.setTinhTrangXacNhan(VaccomUtil.DUKIEN); - phieuHenTiem.setNgayCheckin(StringPool.BLANK); - phieuHenTiem.setThongTinCheckin(StringPool.BLANK); - phieuHenTiem.setGioDuocTiem(StringPool.BLANK); - phieuHenTiem.setTrieuChungSauTiem(StringPool.BLANK); - phieuHenTiem.setDieuTriTrieuChung(StringPool.BLANK); - - phieuHenTiemAction.addPhieuHenTiem(phieuHenTiem); + if(findExist.size() == 0 || findExist.isEmpty()){ + PhieuHenTiem phieuHenTiem = new PhieuHenTiem(); + + phieuHenTiem.setGioHenTiem(lichTiemChung.getGioHenTiem()); + phieuHenTiem.setLichTiemChungId(lichTiemChung.getId()); + phieuHenTiem.setCaTiemChungId(0); + phieuHenTiem.setNgayHenTiem(lichTiemChung.getNgayBatDau()); + phieuHenTiem.setNguoiTiemChungId(nguoiTiemChung.getId()); + phieuHenTiem.setMaQR(VaccomUtil.generateQRCode("pht", 4)); + phieuHenTiem.setLanTiem(lanTiem); + phieuHenTiem.setTinhTrangXacNhan(VaccomUtil.DUKIEN); + phieuHenTiem.setNgayCheckin(StringPool.BLANK); + phieuHenTiem.setThongTinCheckin(StringPool.BLANK); + phieuHenTiem.setGioDuocTiem(StringPool.BLANK); + phieuHenTiem.setTrieuChungSauTiem(StringPool.BLANK); + phieuHenTiem.setDieuTriTrieuChung(StringPool.BLANK); + + phieuHenTiemAction.addPhieuHenTiem(phieuHenTiem); + + + } else { + _log.error("Phieu hen tiem da ton tai : lichtiemchungId : " + phieuHenTiemDto.LichTiemChungID + " - nguoitiemchungid: " + nguoiTiemChungID + " - hovaten : " + nguoiTiemChung.getHoVaTen()); + } nguoiTiemChung.setTinhTrangDangKi(VaccomUtil.DACHUYENSANGPHIEUHEN); nguoiTiemChungAction.update(nguoiTiemChung); + } String msg = MessageUtil.getVNMessageText("phieuhentiem.list.add.success"); diff --git a/backend/src/main/java/org/vaccom/vcmgt/repository/PhieuHenTiemRepository.java b/backend/src/main/java/org/vaccom/vcmgt/repository/PhieuHenTiemRepository.java index a6d3389c..64c96b2e 100644 --- a/backend/src/main/java/org/vaccom/vcmgt/repository/PhieuHenTiemRepository.java +++ b/backend/src/main/java/org/vaccom/vcmgt/repository/PhieuHenTiemRepository.java @@ -30,6 +30,9 @@ public interface PhieuHenTiemRepository extends JpaRepository findByNguoiTiemChungId(long id); + @Query(value="SELECT * FROM " + DBConstant._PHIEUTIEM_TABLE_NAME + " WHERE LichTiemChungID = :lichTiemChungID and NguoiTiemChungID = :nguoiTiemChungID", nativeQuery = true) + public List findExist(@Param(value = "lichTiemChungID") long lichTiemChungID, @Param(value = "nguoiTiemChungID") long nguoiTiemChungID); + @Query(value="SELECT * FROM " + DBConstant._PHIEUTIEM_TABLE_NAME + " WHERE LichTiemChungID = :lichTiemChungID and TinhTrangXacNhan = :tinhTrangXacNhan", nativeQuery = true) public List findByLichTiemChungId_TinhTrangXacNhan(@Param(value = "lichTiemChungID") long lichTiemChungID, @Param(value = "tinhTrangXacNhan") int tinhTrangXacNhan); diff --git a/backend/src/main/java/org/vaccom/vcmgt/service/PhieuHenTiemService.java b/backend/src/main/java/org/vaccom/vcmgt/service/PhieuHenTiemService.java index e2295858..da55649d 100644 --- a/backend/src/main/java/org/vaccom/vcmgt/service/PhieuHenTiemService.java +++ b/backend/src/main/java/org/vaccom/vcmgt/service/PhieuHenTiemService.java @@ -44,4 +44,6 @@ public List searchPhieuHenTiem(Long lichTiemChungId, Long caTiemCh public List findByLichTiemChungId_TinhTrangXacNhan(long LichTiemChungID, int TinhTrangXacNhan); public PhieuHenTiem update(PhieuHenTiem phieuHenTiem); +public List findExist (long lichTiemChungId, long nguoiTiemChungId); + } diff --git a/backend/src/main/java/org/vaccom/vcmgt/service/impl/PhieuHenTiemServiceImpl.java b/backend/src/main/java/org/vaccom/vcmgt/service/impl/PhieuHenTiemServiceImpl.java index a9e0b219..7b8282b7 100644 --- a/backend/src/main/java/org/vaccom/vcmgt/service/impl/PhieuHenTiemServiceImpl.java +++ b/backend/src/main/java/org/vaccom/vcmgt/service/impl/PhieuHenTiemServiceImpl.java @@ -214,4 +214,9 @@ public PhieuHenTiem update(PhieuHenTiem phieuHenTiem) { return phieuHenTiemRepository.save(phieuHenTiem); } + @Override + public List findExist(long lichTiemChungId, long nguoiTiemChungId) { + return phieuHenTiemRepository.findExist(lichTiemChungId, nguoiTiemChungId); + } + } From e8fbdeb39f43a6f10df92d4f24230d093265157f Mon Sep 17 00:00:00 2001 From: vietdd Date: Tue, 4 Jan 2022 21:02:52 +0700 Subject: [PATCH 3/3] =?UTF-8?q?Fix=20c=E1=BB=A9ng=20m=C5=A9i=203=20cho=20h?= =?UTF-8?q?=E1=BB=87=20th=E1=BB=91ng=20vaccom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vcmgt/controler/ApplicationControler.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java b/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java index b44585bb..cff88b3f 100644 --- a/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java +++ b/backend/src/main/java/org/vaccom/vcmgt/controler/ApplicationControler.java @@ -2074,13 +2074,15 @@ public ResponseEntity addPhieuHenTiemList(HttpServletRequest request, HttpSer for (Integer nguoiTiemChungID : NguoiTiemChungIdList) { NguoiTiemChung nguoiTiemChung = nguoiTiemChungAction.findById(nguoiTiemChungID); - List muiTiemChungList = muiTiemChungAction.findByCongDan_ID(nguoiTiemChung.getCongDanID()); - int lanTiem = 0; - if (Validator.isNull(muiTiemChungList)) { - lanTiem = 1; - } else { - lanTiem = muiTiemChungList.size() + 1; - } +// List muiTiemChungList = muiTiemChungAction.findByCongDan_ID(nguoiTiemChung.getCongDanID()); +// int lanTiem = 0; +// if (Validator.isNull(muiTiemChungList)) { +// lanTiem = 1; +// } else { +// lanTiem = muiTiemChungList.size() + 1; +// } +// Fix cứng mũi tiêm = 3 (04/01/2022) + int lanTiem = 3; List findExist = phieuHenTiemAction.findExist(phieuHenTiemDto.LichTiemChungID, nguoiTiemChungID); if (Validator.isNull(nguoiTiemChung)) {